fix(AnchoredOverlay): replace broken stories (#5056) #2361
This file contains 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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
guard: | |
name: Guard | |
runs-on: ubuntu-latest | |
outputs: | |
# To avoid deploying documentation for unrelease changes, we check the number of changeset files. | |
# If it's 0, we deploy. | |
should_deploy: ${{ steps.changeset-count.outputs.change_count == 0 && steps.has-pages.outputs.pages == 1 }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: changeset-count | |
run: echo "::set-output name=change_count::$(ls .changeset/*.md | grep -v README | wc -l | xargs)" | |
# Log changeset count for debugging purposes | |
- name: Log changeset count | |
run: echo ${{ steps.changeset-count.outputs.change_count }} | |
- id: has-pages | |
name: Check if pages is configured | |
run: | | |
if gh api --silent https://api.github.com/repos/${{ github.repository }}/pages ; then | |
echo "pages=1" >> $GITHUB_OUTPUT | |
else | |
echo "pages=0" >> $GITHUB_OUTPUT | |
fi | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Log has pages | |
run: echo ${{ steps.has-pages.outputs.pages }} | |
# Log guard output for debugging purposes | |
- name: Log guard output | |
run: echo ${{ needs.guard.outputs.should_deploy }} | |
deploy: | |
name: Production | |
needs: [guard] | |
if: ${{ needs.guard.outputs.should_deploy == 'true' }} | |
uses: primer/.github/.github/workflows/deploy.yml@5d641c4a200cecaddcb067822ea54dd17ae0a821 | |
secrets: | |
gh_token: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
node_version: 18 | |
install: npm ci | |
build: npm run build:docs | |
output_dir: docs/public |