chore(docs): update code docs #319
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 API Docs | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - '.github/workflows/build.yml' | |
| - '.github/workflows/update.yml' | |
| - '.gitignore' | |
| - 'jsdoc.json' | |
| - 'LICENSE' | |
| - 'README.md' | |
| - 'renovate.json' | |
| workflow_dispatch: | |
| concurrency: | |
| group: deploy-api-docs | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up SSH | |
| env: | |
| DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} | |
| VPS_KNOWN_HOSTS: ${{ secrets.VPS_KNOWN_HOSTS }} | |
| run: | | |
| mkdir -p ~/.ssh | |
| chmod 700 ~/.ssh | |
| printf '%s\n' "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519 | |
| chmod 600 ~/.ssh/id_ed25519 | |
| printf '%s\n' "$VPS_KNOWN_HOSTS" > ~/.ssh/known_hosts | |
| chmod 644 ~/.ssh/known_hosts | |
| - name: Deploy docs/ to VPS via rsync | |
| env: | |
| VPS_HOST: ${{ secrets.VPS_HOST }} | |
| VPS_USER: ${{ secrets.VPS_USER }} | |
| run: | | |
| rsync -avz --delete \ | |
| -e "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes" \ | |
| docs/ \ | |
| "${VPS_USER}@${VPS_HOST}:/opt/jellyrock/api-docs/" | |
| # Deploy heartbeat (ADR-0005). Values passed via env, never inlined into | |
| # the script, to avoid commit-message shell injection. No-op until the | |
| # GOTIFY_URL secret is set. | |
| - name: Notify Gotify on success | |
| if: success() | |
| env: | |
| GOTIFY_URL: ${{ secrets.GOTIFY_URL }} | |
| REPO: ${{ github.event.repository.name }} | |
| COMMIT_MSG: ${{ github.event.head_commit.message }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| [ -z "$GOTIFY_URL" ] && { echo "GOTIFY_URL unset — skipping"; exit 0; } | |
| curl -fsS -m 10 "$GOTIFY_URL" \ | |
| -F "priority=3" \ | |
| -F "title=${REPO} deploy ok" \ | |
| -F "message=Commit: ${COMMIT_MSG} | |
| Run: ${RUN_URL}" || true | |
| - name: Notify Gotify on failure | |
| if: failure() | |
| env: | |
| GOTIFY_URL: ${{ secrets.GOTIFY_URL }} | |
| REPO: ${{ github.event.repository.name }} | |
| COMMIT_MSG: ${{ github.event.head_commit.message }} | |
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| run: | | |
| [ -z "$GOTIFY_URL" ] && exit 0 | |
| curl -fsS -m 10 "$GOTIFY_URL" \ | |
| -F "priority=8" \ | |
| -F "title=${REPO} deploy FAILED" \ | |
| -F "message=Commit: ${COMMIT_MSG} | |
| Run: ${RUN_URL}" || true |