Add #nodeploy #37
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: "Pages" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["master"] | |
| paths: | |
| - ".github/workflows/pages.yaml" | |
| - ".vitepress/**" | |
| - "docs/**" | |
| - "package*.json" | |
| env: | |
| crawler-id: "740ca24d-65fd-4f25-b397-16ebcec2f7fd" | |
| purge-domain: "" | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: "Build" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| if: ${{ !contains(github.event.head_commit.message, '#nodeploy') }} | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Debug CTX github" | |
| continue-on-error: true | |
| env: | |
| GITHUB_CTX: ${{ toJSON(github) }} | |
| run: echo "$GITHUB_CTX" | |
| - name: "Setup Node 24" | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - name: "Configure Pages" | |
| uses: actions/configure-pages@v5 | |
| - name: "Install Dependencies" | |
| run: | | |
| npm ci | |
| - name: "Run Build" | |
| run: | | |
| npm run build | |
| - name: "Upload Pages Artifact" | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: .vitepress/dist | |
| - name: "Send Failure Notification" | |
| if: ${{ failure() }} | |
| uses: sarisia/actions-status-discord@v1 | |
| with: | |
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
| deploy: | |
| name: "Deploy" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| needs: build | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: "Deploy Pages" | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |
| - name: "Send Deploy Notification" | |
| if: ${{ !cancelled() }} | |
| continue-on-error: true | |
| uses: sarisia/actions-status-discord@v1 | |
| with: | |
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
| description: ${{ steps.deployment.outputs.page_url }} | |
| post: | |
| name: "Post-Deploy" | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| needs: deploy | |
| steps: | |
| - name: "Purge Cache" | |
| if: ${{ env.purge-domain != '' }} | |
| uses: cssnr/cloudflare-purge-cache-action@v2 | |
| with: | |
| zones: ${{ env.purge-domain }} | |
| token: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| - name: "Algolia Crawler" | |
| if: ${{ env.crawler-id != '' }} | |
| uses: cssnr/algolia-crawler-action@v1 | |
| with: | |
| crawler_id: ${{ env.crawler-id }} | |
| crawler_user_id: ${{ secrets.CRAWLER_USER_ID }} | |
| crawler_api_key: ${{ secrets.CRAWLER_API_KEY }} | |
| - name: "Send Post-Deploy Notification" | |
| if: ${{ failure() }} | |
| uses: sarisia/actions-status-discord@v1 | |
| with: | |
| webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
| description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }} |