Skip to content

Commit 4267e0e

Browse files
authored
fix(sage-monorepo): pass GHCR credentials to the dev container in the release workflow (#2876)
1 parent 2f803b5 commit 4267e0e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/workflows/release.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
# Extract the product name (part before the first slash) and version (part after the first slash)
2727
PRODUCT=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f1)
28-
VERSION=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/' -f2)
28+
VERSION=$(echo "${GITHUB_REF#refs/tags/}" | cut -d'/v' -f2)
2929
3030
# Output extracted values for the rest of the job
3131
echo "PRODUCT=${PRODUCT}" >> $GITHUB_ENV
@@ -40,5 +40,6 @@ jobs:
4040
- name: Build the images of all the OC projects
4141
run: |
4242
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \
43+
&& echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin ghcr.io \
4344
&& export VERSION=${{ env.VERSION }} \
4445
&& nx build-image ${{ env.PRODUCT }}-apex --configuration=ci"

apps/openchallenges/apex/project.json

+9-10
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,20 @@
2020
"build-image": {
2121
"executor": "@nx-tools/nx-container:build",
2222
"options": {
23-
"context": "{projectRoot}",
24-
"metadata": {
25-
"images": ["ghcr.io/sage-bionetworks/{projectName}"]
26-
},
27-
"push": false
23+
"context": "{projectRoot}"
2824
},
2925
"configurations": {
3026
"local": {
31-
"tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"]
27+
"metadata": {
28+
"images": ["ghcr.io/sage-bionetworks/{projectName}"],
29+
"tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"]
30+
}
3231
},
3332
"ci": {
34-
"cache-from": ["type=gha"],
35-
"cache-to": ["type=gha,mode=max"],
36-
"push": true,
37-
"tags": ["type=semver,pattern={{version}},value=${VERSION}", "type=sha"]
33+
"metadata": {
34+
"images": ["ghcr.io/sage-bionetworks/{projectName}"],
35+
"tags": ["type=raw,value=${VERSION}", "type=sha"]
36+
}
3837
}
3938
},
4039
"defaultConfiguration": "local"

0 commit comments

Comments
 (0)