Skip to content

Commit 3bfa454

Browse files
committed
ci(release): add semnatic release and Github workflow
1 parent dbde8fe commit 3bfa454

File tree

4 files changed

+19276
-9421
lines changed

4 files changed

+19276
-9421
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release Image
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ '*' ]
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
jobs:
11+
Verify:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup Node.js environment
16+
uses: actions/setup-node@v1.4.5
17+
with:
18+
node-version: 14
19+
- name: Setup and install dependencies
20+
run: |
21+
npm ci
22+
npm run build
23+
- name: Test
24+
run: npm run test
25+
- name: Newman Tests
26+
run: npm run test:newman
27+
Publish:
28+
runs-on: ubuntu-latest
29+
if: ${{ github.ref == 'refs/heads/main' }}
30+
needs: [Verify]
31+
steps:
32+
- uses: actions/checkout@v2
33+
- name: Setup Node.js environment
34+
uses: actions/setup-node@v1.4.5
35+
with:
36+
node-version: 14
37+
- name: Package 📦
38+
run: |
39+
aws ecr-public get-login-password --region ap-southeast-2 | docker login --username AWS --password-stdin public.ecr.aws/m0q0z2r6
40+
npm ci
41+
npm run build
42+
- name: Publish 🚀
43+
run: npm run release

.releaserc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
"@semantic-release/commit-analyzer",
7+
"@semantic-release/release-notes-generator",
8+
"@semantic-release/changelog",
9+
"@semantic-release/git",
10+
[
11+
"@semantic-release/exec",
12+
{
13+
"prepareCmd": "docker build -t lambda-container-service ."
14+
}
15+
],
16+
[
17+
"@semantic-release-plus/docker",
18+
{
19+
"name": " public.ecr.aws/m0q0z2r6/lambda-container-service",
20+
"registryUrl": "public.ecr.aws",
21+
"publishLatestTag": true,
22+
"publishMajorTag": true,
23+
"publishMinorTag": true,
24+
"skipLogin" : true
25+
}
26+
]
27+
]
28+
}

0 commit comments

Comments
 (0)