Update server #2
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
| name: Update server | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 2 * * 2' | |
| jobs: | |
| provision-server: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: python:3.10-alpine | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Provision | |
| run: | | |
| apk add openssh-client | |
| eval $(ssh-agent -s) | |
| echo "${{ secrets.SSH_PRIVATE_KEY }}" | tr -d '\r' | ssh-add - | |
| mkdir -p ~/.ssh | |
| chmod 700 ~/.ssh | |
| pip3 install --root-user-action=ignore ansible | |
| ansible-galaxy install -r ansible/requirements.yml | |
| export ANSIBLE_HOST_KEY_CHECKING=false | |
| ansible-playbook ansible/update.yml -i ansible/inventory.yml |