Deploy to server #76
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: Deploy to server | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11.12' | |
| - name: Install Ansible | |
| run: | | |
| sudo apt update | |
| sudo apt install -y ansible | |
| - name: Set up SSH agent | |
| uses: webfactory/[email protected] | |
| with: | |
| ssh-private-key: ${{ secrets.DISCORD_BOT_DEPLOY_KEY }} | |
| - name: Deploy Discord Bot with ansible | |
| run: ansible-playbook -i ${{ secrets.DISCORD_BOT_SERVER_HOST }}, ansible/deploy-playbook.yml --private-key="/home/runner/.ssh/id_rsa" --user=root | |
| env: | |
| ANSIBLE_HOST_KEY_CHECKING: "false" |