changed explorer.yml

added another job which will handle production and preview deployment on pull request
This commit is contained in:
joeaba 2021-10-21 12:40:57 +05:30 committed by GitHub
parent 71d0bd4605
commit 87b3c141c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 15 deletions

View File

@ -1,4 +1,3 @@
name: Explorer
on:
push:
@ -6,25 +5,20 @@ on:
paths:
- 'explorer/**'
pull_request_target:
branches: [ master ]
branches:
- master
paths:
- 'explorer/**'
jobs:
check-explorer:
runs-on: ubuntu-latest
defaults:
run:
working-directory: explorer
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-node@v2
with:
# "node" (v16) is not supported by node-sass yet
# https://github.com/sass/node-sass/pull/3090
node-version: '14'
cache: 'npm'
cache-dependency-path: explorer/package-lock.json
@ -36,11 +30,24 @@ jobs:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-org-id: ${{ secrets.ORG_ID}}
vercel-project-id: ${{ secrets.PROJECT_ID}}
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
github-token: ${{ secrets.PAT }} #Optional
vercel-org-id: ${{ secrets.ORG_ID}} #Required
vercel-project-id: ${{ secrets.PROJECT_ID}} #Required
working-directory: ./explorer
scope: ${{ secrets.TEAM_ID}}
# vercel-args: '--prod' #for production
scope: ${{ secrets.TEAM_ID }}
production:
needs: check-explorer
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required
github-token: ${{ secrets.PAT }} #Optional
vercel-args: '--prod' #for production
vercel-org-id: ${{ secrets.ORG_ID}} #Required
vercel-project-id: ${{ secrets.PROJECT_ID}} #Required
working-directory: ./explorer
scope: ${{ secrets.TEAM_ID }}