This repository was archived by the owner on Jun 26, 2025. It is now read-only.
yes #51
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 | |
| env: | |
| TF_VAR_remote_user: ${{ secrets.SERVER_USER }} | |
| TF_VAR_remote_host: ${{ secrets.SERVER_IP }} | |
| TF_VAR_remote_directory: /opt/progsoc/progcomp2025/competition | |
| 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' | |
| - uses: hashicorp/setup-terraform@v3 | |
| - name: Init OpenTofu | |
| working-directory: deploy | |
| run: terraform init -input=false | |
| - name: Apply OpenTofu | |
| working-directory: deploy | |
| run: terraform apply -auto-approve -input=false -no-color | |
| - name: Commit | |
| run: git commit -am "Deploy to server" | |
| - name: Push changes | |
| run: git push origin main |