Update Dependencies and Workflows (#7) #39
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: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: "Build" | |
| if: ${{ !contains(github.event.head_commit.message, '#nodeploy') || github.actor != 'dependabot[bot]' }} | |
| uses: cssnr/workflows/.github/workflows/npm-build.yaml@master | |
| permissions: | |
| contents: read | |
| with: | |
| build: "npm run build" | |
| path: ".vitepress/dist" | |
| pages: true | |
| 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 Discord 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 }} |