-
Notifications
You must be signed in to change notification settings - Fork 393
78 lines (69 loc) · 2.41 KB
/
Copy pathdocumentation.yml
File metadata and controls
78 lines (69 loc) · 2.41 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
name: Documentation
on:
pull_request:
issue_comment:
types: [created]
workflow_call:
inputs:
is-release:
description: Whether this is invoked from the Release workflow (skip PR permission gating).
type: boolean
required: false
default: false
secrets:
SURGE_LOGIN:
required: true
SURGE_TOKEN:
required: true
GH_PR_TOKEN:
required: true
jobs:
check-permissions:
if: github.event_name == 'issue_comment'
uses: patternfly/.github/.github/workflows/check-team-membership.yml@fdb52a63a2220ec8a3b6c2d43f312cda708ffa06
secrets: inherit
deploy:
name: Build, test & deploy
runs-on: ubuntu-latest
needs: check-permissions
if: >-
${{ !cancelled() &&
(inputs.is-release || github.event_name != 'issue_comment' || needs.check-permissions.outputs.allowed == 'true') }}
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
GH_PR_NUM: ${{ needs.check-permissions.outputs.pr-number }}
steps:
- name: Check out project from PR branch
if: github.event_name == 'issue_comment'
uses: actions/checkout@v4
with:
ref: refs/pull/${{ env.GH_PR_NUM }}/head
- name: Check out project
if: github.event_name != 'issue_comment'
uses: actions/checkout@v4
- name: Set up and build project
uses: ./.github/actions/setup-project
- name: Build documentation
run: yarn build:docs
- name: Upload documentation preview
if: ${{ !cancelled() && github.event_name != 'pull_request' }}
run: node .github/upload-preview.mjs packages/react-docs/public
- name: Run accessibility tests
run: yarn serve:docs & yarn test:a11y
- name: Upload accessibility results
if: ${{ !cancelled() && github.event_name != 'pull_request' }}
run: node .github/upload-preview.mjs packages/react-docs/coverage
- name: Upload docs artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: documentation
path: packages/react-docs/public
- name: Upload a11y artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: a11y-coverage
path: packages/react-docs/coverage