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 - name: Save PR number if: github.event_name == 'pull_request' run: echo "${{ github.event.pull_request.number }}" > pr_number.txt - name: Upload PR number if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: name: pr-number path: pr_number.txt