-
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (74 loc) · 2.23 KB
/
pages.yaml
File metadata and controls
87 lines (74 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: "Pages"
on:
workflow_dispatch:
push:
branches: ["master"]
paths:
- ".github/workflows/pages.yaml"
- ".vitepress/**"
- "docs/**"
- "package*.json"
env:
crawler-id: "7a46f2b7-7169-4936-986d-21391c3134d4"
purge-domain: ""
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
name: "Build"
if: ${{ !contains(github.event.head_commit.message, '#nodeploy') }}
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@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
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@v2
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@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}