1
1
mirror of https://github.com/primer/css.git synced 2024-12-28 16:45:52 +03:00
css/.github/workflows/deploy_production.yml

47 lines
1.2 KiB
YAML
Raw Normal View History

2021-04-05 20:25:49 +03:00
name: Deploy
2021-04-06 04:25:02 +03:00
on:
push:
2021-04-06 04:40:16 +03:00
branches:
2021-04-20 18:44:13 +03:00
- 'main'
permissions:
contents: write
pages: write
id-token: write
deployments: write
issues: write
statuses: write
checks: write
2021-04-05 20:25:49 +03:00
jobs:
guard:
name: Guard
2021-04-06 02:02:51 +03:00
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 }}
2021-04-05 20:25:49 +03:00
steps:
- uses: actions/checkout@v3
2021-04-06 04:31:49 +03:00
2021-04-06 04:25:02 +03:00
- id: changeset-count
run: echo "::set-output name=change_count::$(ls .changeset/*.md | grep -v README | wc -l | xargs)"
2021-04-06 04:31:49 +03:00
# Log changeset count for debugging purposes
- name: Log changeset count
run: echo ${{ steps.changeset-count.outputs.change_count }}
# Log guard output for debugging purposes
- name: Log guard output
run: echo ${{ needs.guard.outputs.should_deploy }}
deploy:
2022-04-20 12:04:27 +03:00
if: ${{ github.repository == 'primer/css' }}
name: Production
needs: [guard]
uses: primer/.github/.github/workflows/deploy.yml@main
with:
node_version: 14
install: yarn && cd docs && yarn && cd ..
build: yarn build:docs
output_dir: docs/public