-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.46 KB
/
main.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
name: CI
# Controls when the workflow will run
on:
push:
branches: [main]
pull_request:
branches: [main]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
docker:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: Run build
run: npm run build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.DEPLOYMENT_KEY }}
aws-secret-access-key: ${{ secrets.DEPLOYMENT_SECRET }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: 'true'
registry-type: public
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Build, tag, and push QA image to Amazon ECR
env:
DEV_ENV_TRANSFORMER: ${{ secrets.DEV_ENV_TRANSFORMER }}
run: npm run build && docker build -t public.ecr.aws/m6j0z5r2/paigo-starter-app:${SHORT_SHA} . && docker push public.ecr.aws/m6j0z5r2/paigo-starter-app:${SHORT_SHA}