This repository was archived by the owner on Jun 26, 2025. It is now read-only.
Deploy to Server #3
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: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Tailscale | |
| uses: tailscale/github-action@v3 | |
| with: | |
| tags: tag:ci | |
| oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
| oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r deploy/requirements.txt | |
| - name: Add Server IP to Ansible hosts | |
| run: | | |
| echo "[progcomp2025]" >> deploy/ansible_hosts | |
| echo "${{ secrets.SERVER_IP }}" >> deploy/ansible_hosts | |
| - name: Run Ansible playbook | |
| run: | | |
| ansible-playbook deploy/ansible-deploy.yaml \ | |
| --inventory deploy/ansible_hosts \ | |
| --extra-vars "ansible_user=${{ secrets.SERVER_USER }}" | |
| env: | |
| ANSIBLE_HOST_KEY_CHECKING: false | |
| ANSIBLE_CONFIG: deploy/ansible.cfg |