Repository navigation
security: enforce client_secret on PKCE token exchange #10
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: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Tag previous image for rollback | |
| run: | | |
| docker pull ghcr.io/pmlabs-org/mcp-toggl:latest || true | |
| docker tag ghcr.io/pmlabs-org/mcp-toggl:latest \ | |
| ghcr.io/pmlabs-org/mcp-toggl:previous || true | |
| docker push ghcr.io/pmlabs-org/mcp-toggl:previous || true | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/pmlabs-org/mcp-toggl:latest | |
| ghcr.io/pmlabs-org/mcp-toggl:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Setup SSH agent | |
| uses: webfactory/ssh-agent@v0.9.0 | |
| with: | |
| ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }} | |
| - name: Add droplet to known hosts | |
| run: ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts | |
| - name: Deploy to droplet | |
| run: | | |
| ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} \ | |
| "echo '${{ secrets.GHCR_TOKEN }}' | docker login ghcr.io -u '${{ github.actor }}' --password-stdin \ | |
| && cd /opt/pmin-mcpinfrastructure \ | |
| && docker compose pull toggl \ | |
| && docker compose up -d --force-recreate toggl \ | |
| && docker logout ghcr.io" | |
| - name: Health check | |
| run: | | |
| for i in 1 2 3 4 5; do | |
| if curl -sf https://toggl.mcp.pathfindermarketing.com.au/.well-known/oauth-authorization-server > /dev/null; then | |
| echo "Health check passed"; exit 0 | |
| fi | |
| echo "Attempt $i/5 — retrying in 15s..."; sleep 15 | |
| done | |
| echo "Health check failed"; exit 1 |