Skip to content

Commit fae9af2

Browse files
authored
Merge pull request #1303 from primer/vercel_action
Deploying the primer.style website with a github action instead of vercel-bot
2 parents 12b5d9b + 22957e2 commit fae9af2

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
6+
paths:
7+
- 'src/**'
8+
- 'docs/**'
9+
- '.github/workflows/deploy*.yml'
10+
- 'package.json'
11+
jobs:
12+
deploy-preview:
13+
if: ${{ github.repository == 'primer/css' }}
14+
name: Preview
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@master
18+
- uses: chrnorm/deployment-action@releases/v1
19+
name: Create GitHub deployment
20+
id: deployment
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
environment: Preview
24+
25+
- name: Vercel Action
26+
uses: amondnet/vercel-action@v20.0.0
27+
id: vercel-action
28+
with:
29+
github-token: ${{ secrets.GITHUB_TOKEN }}
30+
vercel-token: ${{ secrets.VERCEL_TOKEN_SHARED }}
31+
github-comment: false
32+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID_SHARED }}
33+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
34+
35+
- name: Update deployment status (success)
36+
if: success()
37+
uses: chrnorm/deployment-status@releases/v1
38+
with:
39+
token: ${{ secrets.GITHUB_TOKEN }}
40+
environment_url: ${{ steps.vercel-action.outputs.preview-url }}
41+
state: "success"
42+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
43+
44+
- name: Update deployment status (failure)
45+
if: failure()
46+
uses: chrnorm/deployment-status@releases/v1
47+
with:
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
state: "failure"
50+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- 'src/**'
8+
- 'docs/**'
9+
- '.github/workflows/deploy*.yml'
10+
- 'package.json'
11+
jobs:
12+
deploy:
13+
if: ${{ github.repository == 'primer/css' }}
14+
name: Production
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@master
18+
19+
# Check the number of changeset files, if it's 0 we deploy
20+
- id: changeset-count
21+
run: echo "::set-output name=CHANGE_COUNT::$(ls .changeset/*.md | grep -v README | wc -l | xargs)"
22+
23+
- if: ${{ steps.changeset-count.outputs.CHANGE_COUNT == 0 }}
24+
name: Vercel Action
25+
uses: amondnet/vercel-action@v20.0.0
26+
id: vercel-action
27+
with:
28+
github-token: ${{ secrets.GITHUB_TOKEN }}
29+
vercel-token: ${{ secrets.VERCEL_TOKEN_SHARED }}
30+
vercel-args: '--prod'
31+
github-comment: false
32+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID_SHARED }}
33+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}

vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
}
2727
],
2828
"github": {
29-
"silent": true
29+
"enabled": false
3030
}
3131
}

0 commit comments

Comments
 (0)