-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (86 loc) · 2.7 KB
/
node.js.yml
File metadata and controls
107 lines (86 loc) · 2.7 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: 'Build'
on:
push:
branches: [ feature/**, review/** ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [13.x]
steps:
- uses: actions/checkout@v2
- name: Cache Node modules
id: node-Cache
uses: actions/cache@v2
with:
path: |
**/node_modules
key: node-modules-${{ hashFiles('hello-world/package-lock.json') }}
- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v1
with:
node-version: ${{matrix.node-version}}
- run: |
cd api
# uncomment npm install if running locally using nektos/act
npm install
npm run test
build:
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [13.x]
steps:
- uses: actions/checkout@v2
- name: Cache Node modules
id: node-Cache
uses: actions/cache@v2
with:
path: |
**/node_modules
key: node-modules-${{ hashFiles('hello-world/package-lock.json') }}
- name: Install Dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
run: |
cd api
npm install
- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v1
with:
node-version: ${{matrix.node-version}}
- run: |
cd api
npm run build-local
pre-deploy-check:
name: 'pre-deploy-check'
needs: build
runs-on: ubuntu-latest
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest
defaults:
run:
shell: bash
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v2
# Configure AWS CLI
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
# Install the latest version of Terraform CLI and configure the Terraform CLI configuration file with a Terraform Cloud user API token
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
# Initialize a new or existing Terraform working directory by creating initial files, loading any remote state, downloading modules, etc.
- name: Terraform Init
run: terraform init -backend-config=backend.hcl
# Checks that all Terraform configuration files adhere to a canonical format
- name: Terraform Format
run: terraform fmt -check
# Generates an execution plan for Terraform
- name: Terraform Plan
run: terraform plan