-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (74 loc) · 2.56 KB
/
github-actions.js.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# This is a basic workflow to help you get started with Actions
name: CI-CD
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: ['dev']
pull_request:
branches: ['dev']
# # Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Build_App:
# The type of runner that the job will run on
runs-on: ubuntu-latest
environment: Production
strategy:
matrix:
node-version: [14.x]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node-version }}
# install applicaion dependencies
- name: Install dependencies
run: |
yarn
# build and test the apps
- name: Test the app
run: |
yarn test
- name: Build the app
run: |
yarn build
# This workflow contains multiple jobs
# Sonar_Cloud:
# name: Sonarcloud
# needs: Build_App
# runs-on: ubuntu-latest
# environment: Production
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
# - name: SonarCloud Scan
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# - name: SonarQube Quality Gate check
# uses: sonarsource/sonarqube-quality-gate-action@master
# # Force to fail step after specific time
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Vercel_Deploy:
runs-on: ubuntu-latest
needs: Build_App
environment: Production
steps:
- uses: actions/checkout@v2
- uses: amondnet/vercel-action@v20
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-args: '--prod'
vercel-org-id: ${{ secrets.VERCEL_ORGANIZATION_ID }} #Required
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} #Required
working-directory: ./ #Your Working Directory, Optional