Skip to content

Commit

Permalink
add ansible weekly update action
Browse files Browse the repository at this point in the history
  • Loading branch information
vineelsai26 committed Jan 13, 2024
1 parent 76b37f6 commit c089660
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 17 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/weekly-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Ansible Playbook Weekly Update Servers

on:
push:
branches: ["main"]
paths:
- "ansible/**"
- ".github/workflows/**"
schedule:
- cron: "0 0 * * 6"

env:
ANSIBLE_HOSTS_FILE: ${{ secrets.ANSIBLE_HOSTS_FILE }}
ANSIBLE_SSH_PRIVATE_KEY_FILE: ${{ secrets.ANSIBLE_SSH_PRIVATE_KEY_FILE }}

jobs:
update-servers:
name: Update Servers
runs-on: self-hosted

steps:
- uses: actions/checkout@v3

- name: Set Environment Variables
working-directory: ansible
run: |
mkdir inventory
echo $ANSIBLE_HOSTS_FILE | base64 -d > inventory/hosts
echo $ANSIBLE_SSH_PRIVATE_KEY_FILE | base64 -d > ansible_key
chmod 600 ansible_key
- name: Run Ansible Playbook
run: |
ansible-playbook update.yaml
17 changes: 0 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.*
/**/data/*
/**/config/*
/**/letsencrypt/*
Expand All @@ -8,22 +7,6 @@
/**/jellyfin/*
/**/tdarr/*

!.gitignore
!docker-compose.yml
!run.sh
!stop.sh
!backup.sh
!update.sh
!traefik.yml
!config.yml
!prometheus.yml
!.env.example
!nginx.conf
!default.json

!terraform/**
!ansible/**

ansible*key
inventory
.terraform*
Expand Down

0 comments on commit c089660

Please sign in to comment.