Skip to content

Commit 56c6662

Browse files
committed
ci: add semantic release
1 parent b836f5d commit 56c6662

File tree

1 file changed

+46
-8
lines changed

1 file changed

+46
-8
lines changed

.github/workflows/gh-pages.yml

+46-8
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ jobs:
6464
- name: Install dependencies ⏬
6565
run: npm ci
6666

67+
- name: Semantic Release 🚀
68+
uses: cycjimmy/semantic-release-action@v4
69+
id: semantic
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
with:
74+
semantic_version: 23
75+
6776
- name: Build artifacts 🏗️
6877
run: npm run build
6978

@@ -74,28 +83,57 @@ jobs:
7483
username: ${{ secrets.NEXUS_USERNAME }}
7584
password: ${{ secrets.NEXUS_PASSWORD }}
7685

77-
- name: Build docker gis-client image (main) 🏗️
86+
- name: Build docker gis-client image (latest) 🏗️
7887
uses: docker/build-push-action@v5
7988
with:
8089
context: .
8190
file: Dockerfile.gis.client
8291
tags: |
83-
${{ env.DOCKER_REGISTRY }}/shogun-gis-client-docs:main
92+
${{ env.DOCKER_REGISTRY }}/shogun-gis-client-docs:latest
8493
load: true
8594

86-
- name: Push docker gis-client image to Nexus (main) 📠
95+
- name: Build docker gis-client image (version)
96+
if: steps.semantic.outputs.new_release_published == 'true'
97+
uses: docker/build-push-action@v5
98+
with:
99+
context: .
100+
tags: |
101+
${{ env.DOCKER_REGISTRY }}/shogun-gis-client-docs:${{ steps.semantic.outputs.new_release_version }}
102+
load: true
103+
104+
- name: Push docker gis-client image to Nexus (latest) 📠
87105
run: |
88-
docker push ${{ env.DOCKER_REGISTRY }}/shogun-gis-client-docs:main
106+
docker push ${{ env.DOCKER_REGISTRY }}/shogun-gis-client-docs:latest
89107
90-
- name: Build docker admin-client image (main) 🏗️
108+
- name: Push docker gis-client image to Nexus (version)
109+
if: steps.semantic.outputs.new_release_published == 'true'
110+
run: |
111+
docker push ${{ env.DOCKER_REGISTRY }}/shogun-gis-client-docs:${{ steps.semantic.outputs.new_release_version }}
112+
113+
- name: Build docker admin-client image (latest) 🏗️
91114
uses: docker/build-push-action@v5
92115
with:
93116
context: .
94117
file: Dockerfile.admin.client
95118
tags: |
96-
${{ env.DOCKER_REGISTRY }}/shogun-admin-client-docs:main
119+
${{ env.DOCKER_REGISTRY }}/shogun-admin-client-docs:latest
97120
load: true
98121

99-
- name: Push docker admin-client image to Nexus (main) 📠
122+
- name: Build docker admin-client image (version)
123+
if: steps.semantic.outputs.new_release_published == 'true'
124+
uses: docker/build-push-action@v5
125+
with:
126+
context: .
127+
tags: |
128+
${{ env.DOCKER_REGISTRY }}/shogun-admin-client-docs:${{ steps.semantic.outputs.new_release_version }}
129+
load: true
130+
131+
- name: Push docker admin-client image to Nexus (latest) 📠
100132
run: |
101-
docker push ${{ env.DOCKER_REGISTRY }}/shogun-admin-client-docs:main
133+
docker push ${{ env.DOCKER_REGISTRY }}/shogun-admin-client-docs:latest
134+
135+
- name: Push docker admin-client image to Nexus (version)
136+
if: steps.semantic.outputs.new_release_published == 'true'
137+
run: |
138+
docker push ${{ env.DOCKER_REGISTRY }}/shogun-admin-client-docs:${{ steps.semantic.outputs.new_release_version }}
139+

0 commit comments

Comments
 (0)