Repository navigation
65 lines (58 loc) · 1.94 KB
/
Copy pathdocumentation-deploy.yml
File metadata and controls
65 lines (58 loc) · 1.94 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
name: Documentation deploy
on:
workflow_run:
workflows: [Documentation]
types: [completed]
permissions:
actions: read
contents: read
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
steps:
- name: Check out project
uses: actions/checkout@v4
- name: Set up project
uses: ./.github/actions/setup-project
with:
skip-build: true
- name: Download PR number
uses: actions/download-artifact@v4
with:
name: pr-number
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Read PR number
run: |
set -euo pipefail
PR_NUM=$(cat pr_number.txt)
if ! [[ "$PR_NUM" =~ ^[0-9]+$ ]]; then
echo "Failed to resolve a valid PR number"
exit 1
fi
echo "GH_PR_NUM=$PR_NUM" >> "$GITHUB_ENV"
- name: Download documentation
uses: actions/download-artifact@v4
with:
name: documentation
path: packages/react-docs/public
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Download a11y coverage
uses: actions/download-artifact@v4
with:
name: a11y-coverage
path: packages/react-docs/coverage
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload documentation
run: node .github/upload-preview.mjs packages/react-docs/public
- name: Upload accessibility results
if: ${{ !cancelled() }}
run: node .github/upload-preview.mjs packages/react-docs/coverage