This repository was archived by the owner on Jun 26, 2025. It is now read-only.
rem #54
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: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow}} | |
| cancel-in-progress: true | |
| name: Deploy to Server | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Git User | |
| run: | | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | |
| - 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 }} | |
| use-cache: 'true' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| cache: 'pip' | |
| - 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 |