Skip to content

Commit 1ff183c

Browse files
committed
feat: splitted "release" and "docker-release" into two workflows
1 parent 02c75b4 commit 1ff183c

File tree

2 files changed

+33
-20
lines changed

2 files changed

+33
-20
lines changed

.github/workflows/docker-release.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
name: CD | Release Docker Image
1+
name: Create Docker Image and Release it to Docker Hub
22

33
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- "main"
4+
release:
5+
types: [published]
86

97
jobs:
108
docker:
119
runs-on: ubuntu-latest
12-
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
13-
1410
steps:
1511
- name: Checkout
1612
uses: actions/checkout@v3
@@ -49,16 +45,3 @@ jobs:
4945
password: ${{ secrets.DOCKERHUB_TOKEN }}
5046
repository: ${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}
5147

52-
- name: Setup Node.js
53-
uses: actions/setup-node@v3
54-
with:
55-
node-version: 18
56-
57-
- name: Install dependencies
58-
run: npm install
59-
60-
- name: Release
61-
env:
62-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
63-
run: npx semantic-release
64-

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Create Release on GitHub
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- "main"
8+
9+
jobs:
10+
docker:
11+
runs-on: ubuntu-latest
12+
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Release
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
29+
run: npx semantic-release
30+

0 commit comments

Comments
 (0)