.github/workflows/run_weekly.yml #163
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 8 * * 0' | |
| env: | |
| ANSIBLE_HOST_KEY_CHECKING: False | |
| jobs: | |
| run-weekly: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| playbook: | |
| - "backup-cornelius.yml" | |
| runs-on: arc-runner-set | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - run: echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
| - name: Set up vault secret | |
| run: echo ${{ secrets.VAULT_PASSWORD }} | base64 -d > .vault_password | |
| - name: Install SSH key | |
| uses: shimataro/ssh-key-action@v2.3.1 | |
| with: | |
| key: ${{ secrets.SSH_KEY }} | |
| known_hosts: unnecessary | |
| if_key_exists: ignore | |
| - name: Set up Python 3 | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: pip3 install ansible | |
| - name: Run playbook | |
| run: | | |
| ansible-playbook -i hosts.yml \ | |
| --vault-password-file .vault_password \ | |
| playbooks/${{ matrix.playbook }} |