-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (42 loc) · 1.4 KB
/
deploy_preview.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
name: Deploy
on:
push:
branches-ignore:
- 'main'
jobs:
deploy-preview:
if: ${{ github.repository == 'primer/react' }}
name: Preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create GitHub deployment
uses: chrnorm/deployment-action@v1.2.0
id: deployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: Preview
- name: Deploy with Vercel
uses: amondnet/vercel-action@v20
id: vercel-action
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN_SHARED }}
github-comment: false
vercel-org-id: ${{ secrets.VERCEL_ORG_ID_SHARED }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
- name: Update deployment status (success)
if: success()
uses: chrnorm/deployment-status@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment_url: ${{ steps.vercel-action.outputs.preview-url }}
state: 'success'
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
- name: Update deployment status (failure)
if: failure()
uses: chrnorm/deployment-status@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
state: 'failure'
deployment_id: ${{ steps.deployment.outputs.deployment_id }}