Skip to content

Commit 45f0eb3

Browse files
committed
ci: Add tagname for Docker
1 parent 5395688 commit 45f0eb3

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

File renamed without changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const value = process.argv[2];
2+
3+
const getValue = (string) => {
4+
const value = string.match(/([a-z].*)\/([a-z].*)\/([a-z].*)/)[3];
5+
return value;
6+
};
7+
8+
console.log(getValue(value));

.github/workflows/release.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
outputs:
1212
service: ${{ steps.extract.outputs.service }}
13+
version: ${{ steps.extract.outputs.version }}
1314
steps:
1415
- uses: actions/checkout@v3
1516
with:
@@ -19,7 +20,10 @@ jobs:
1920
node-version: 16
2021
- name: Extract service name
2122
id: extract
22-
run: echo "service=$(node .github/actions/extract-service-in-tag/index.js ${{ github.ref_name }})" >> $GITHUB_OUTPUT
23+
run: echo "service=$(node .github/actions/extract-in-tag/service.js ${{ github.ref_name }})" >> $GITHUB_OUTPUT
24+
- name: Extract version name
25+
id: extract2
26+
run: echo "version=$(node .github/actions/extract-in-tag/version.js ${{ github.ref_name }})" >> $GITHUB_OUTPUT
2327

2428
Lint:
2529
runs-on: ubuntu-latest
@@ -131,8 +135,8 @@ jobs:
131135
context: .
132136
platforms: linux/amd64,linux/arm64
133137
push: true
134-
tags: ghcr.io/formancehq/${{ needs.Extract.outputs.service }}:${{ github.event.release.tag_name }}
138+
tags: ghcr.io/formancehq/${{ needs.Extract.outputs.service }}:${{ needs.Extract.outputs.version }}
135139
build-args: |
136140
APP_SHA=${{ github.event.pull_request.head.sha }}
137-
VERSION=${{ github.event.release.tag_name }}
141+
VERSION=${{ needs.Extract.outputs.version }}
138142
SEGMENT_WRITE_KEY=${{ secrets.SEGMENT_WRITE_KEY_OSS }}

0 commit comments

Comments
 (0)