Skip to content

Commit d1854b3

Browse files
authored
feat(sage-monorepo): tag the images of a product with semver (ARCH-304) (#2871)
1 parent 0ff75a9 commit d1854b3

File tree

4 files changed

+209
-197
lines changed

4 files changed

+209
-197
lines changed

.github/workflows/release.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'openchallenges/v*'
7+
8+
env:
9+
VERSION: ''
10+
11+
jobs:
12+
deploy:
13+
if: github.ref == 'refs/heads/main'
14+
runs-on: ubuntu-22.04-4core-16GBRAM-150GBSSD
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 1
20+
21+
- name: Extract version from Git tag
22+
id: extract_version
23+
run: |
24+
# Get the tag name and remove 'openchallenges/' prefix
25+
VERSION=${GITHUB_REF#refs/tags/openchallenges/}
26+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
27+
echo "Docker image tag will be: ${VERSION}"
28+
29+
- name: Set up the dev container
30+
uses: ./.github/actions/setup-dev-container
31+
32+
- name: Build the images of all the OC projects
33+
run: |
34+
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \
35+
&& export VERSION=${{ env.VERSION }} \
36+
&& nx build-image openchallenges-apex --configuration=ci"

apps/openchallenges/apex/project.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,23 @@
2020
"build-image": {
2121
"executor": "@nx-tools/nx-container:build",
2222
"options": {
23-
"context": "apps/openchallenges/apex",
23+
"context": "{projectRoot}",
2424
"metadata": {
25-
"images": ["ghcr.io/sage-bionetworks/openchallenges-apex"],
25+
"images": ["ghcr.io/sage-bionetworks/{projectName}"],
2626
"tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"]
2727
},
2828
"push": false
29-
}
29+
},
30+
"configurations": {
31+
"local": {},
32+
"ci": {
33+
"cache-from": ["type=gha"],
34+
"cache-to": ["type=gha,mode=max"],
35+
"push": true,
36+
"tags": ["type=semver,pattern={{version}},value=${VERSION}", "type=sha"]
37+
}
38+
},
39+
"defaultConfiguration": "local"
3040
},
3141
"publish-image": {
3242
"executor": "@nx-tools/nx-container:build",

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
"@angular/language-service": "18.2.5",
7676
"@chromatic-com/storybook": "2.0.2",
7777
"@nrwl/js": "19.8.0",
78-
"@nx-tools/container-metadata": "5.0.3",
79-
"@nx-tools/nx-container": "5.0.3",
78+
"@nx-tools/container-metadata": "6.0.2",
79+
"@nx-tools/nx-container": "6.0.2",
8080
"@nx/angular": "19.8.0",
8181
"@nx/cypress": "19.8.0",
8282
"@nx/devkit": "19.8.0",

0 commit comments

Comments
 (0)