fixing a issue

on a pull request it was deploying on preview for 2 times
This commit is contained in:
joeaba 2021-10-22 19:45:41 +05:30 committed by GitHub
parent 396262866f
commit 082ae1f6cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 11 deletions

View File

@ -10,11 +10,13 @@ on:
paths:
- 'explorer/**'
jobs:
check-explorer:
preview:
runs-on: ubuntu-latest
defaults:
run:
working-directory: explorer
if: github.event_name == 'pull_request_target' && github.event.action == 'opened'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
@ -31,23 +33,32 @@ jobs:
- uses: amondnet/vercel-action@v20
with:
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
vercel-project-id: ${{ secrets.PROJECT_ID}} #Required
scope: ${{ secrets.TEAM_ID }}
production:
needs: check-explorer
runs-on: ubuntu-latest
defaults:
run:
working-directory: explorer
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v20
with:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'
cache-dependency-path: explorer/package-lock.json
- run: npm i -g npm@7
- run: npm ci
- run: npm run format
- run: npm run build
- run: npm run test
- uses: actions/checkout@v2
- 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 }}