-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (54 loc) · 1.65 KB
/
release.yml
File metadata and controls
55 lines (54 loc) · 1.65 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
name: Release Image
on:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v1.4.5
with:
node-version: 14
- name: Setup and install dependencies
run: |
npm ci
- name: Unit tests and Coverage
run: |
npm run test
- name: Newman tests
run: |
npm run test:newman
Publish:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
needs: [Verify]
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v1.4.5
with:
node-version: 14
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ap-southeast-2
role-to-assume: arn:aws:iam::045615149555:role/service-image-upload
role-session-name: service-image-upload-session
- name: Publish 🚀
run: |
aws ecr get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin $REPO_REGISTRY
npm ci
npm run release
env:
REPO_NAME: "lambda-container-service"
REPO_URI: "045615149555.dkr.ecr.ap-southeast-2.amazonaws.com/lambda-container-service"
REPO_REGISTRY: "045615149555.dkr.ecr.ap-southeast-2.amazonaws.com"