-
Notifications
You must be signed in to change notification settings - Fork 1.2k
49 lines (44 loc) · 1.3 KB
/
deploy_production.yml
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
name: Deploy
on:
push:
branches:
- 'main'
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
deployments: write
issues: write
statuses: write
checks: 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:
- 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 }}
# Log guard output for debugging purposes
- name: Log guard output
run: echo ${{ needs.guard.outputs.should_deploy }}
deploy:
if: ${{ github.repository == 'primer/css' }}
name: Production
needs: [guard]
uses: primer/.github/.github/workflows/deploy.yml@main
secrets:
gh_token: ${{ secrets.GITHUB_TOKEN }}
with:
node_version: 18
install: npm ci && cd docs && npm ci && cd ..
build: npm run build:docs
output_dir: docs/public