Skip to content

Commit

Permalink
fix sir
Browse files Browse the repository at this point in the history
  • Loading branch information
vineelsai26 committed Jan 13, 2024
1 parent c089660 commit b848f83
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/weekly-update.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
name: Ansible Playbook Weekly Update Servers

on:
push:
branches: ["main"]
paths:
- "ansible/**"
- ".github/workflows/**"
schedule:
- cron: "0 0 * * 6"
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 }}
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
update-servers:
name: Update Servers
runs-on: self-hosted

steps:
- uses: actions/checkout@v3
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: 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
- name: Run Ansible Playbook
working-directory: ansible
run: |
ansible-playbook update.yaml

0 comments on commit b848f83

Please sign in to comment.