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:
|
|
|
|
- main
|
2021-04-06 04:25:02 +03:00
|
|
|
paths:
|
|
|
|
- 'src/**'
|
|
|
|
- 'docs/**'
|
2021-04-06 04:40:16 +03:00
|
|
|
- '.github/workflows/deploy*.yml'
|
2021-04-06 04:25:02 +03:00
|
|
|
- 'package.json'
|
2021-04-05 20:25:49 +03:00
|
|
|
jobs:
|
2021-04-06 04:31:49 +03:00
|
|
|
deploy:
|
2021-04-06 04:40:16 +03:00
|
|
|
if: ${{ github.repository == 'primer/css' }}
|
2021-04-06 04:31:49 +03:00
|
|
|
name: Production
|
2021-04-06 02:02:51 +03:00
|
|
|
runs-on: ubuntu-latest
|
2021-04-05 20:25:49 +03:00
|
|
|
steps:
|
2021-04-07 07:53:07 +03:00
|
|
|
- uses: actions/checkout@v2
|
2021-04-06 04:31:49 +03:00
|
|
|
|
|
|
|
# Check the number of changeset files, if it's 0 we deploy
|
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
|
|
|
|
2021-04-10 01:32:29 +03:00
|
|
|
- if: ${{ steps.changeset-count.outputs.CHANGE_COUNT == 0 }}
|
2021-04-06 04:40:16 +03:00
|
|
|
name: Vercel Action
|
2021-04-07 07:53:07 +03:00
|
|
|
uses: amondnet/vercel-action@v20
|
2021-04-06 04:31:49 +03:00
|
|
|
id: vercel-action
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
vercel-token: ${{ secrets.VERCEL_TOKEN_SHARED }}
|
2021-04-06 04:40:16 +03:00
|
|
|
vercel-args: '--prod'
|
2021-04-06 04:31:49 +03:00
|
|
|
github-comment: false
|
|
|
|
vercel-org-id: ${{ secrets.VERCEL_ORG_ID_SHARED }}
|
|
|
|
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|