Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sage-monorepo): tag the images of a product with semver (ARCH-304) #2871

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: release

on:
push:
tags:
- 'openchallenges/v*'

env:
VERSION: ''

jobs:
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04-4core-16GBRAM-150GBSSD
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Extract version from Git tag
id: extract_version
run: |
# Get the tag name and remove 'openchallenges/' prefix
VERSION=${GITHUB_REF#refs/tags/openchallenges/}
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "Docker image tag will be: ${VERSION}"

- name: Set up the dev container
uses: ./.github/actions/setup-dev-container

- name: Build the images of all the OC projects
run: |
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \
&& export VERSION=${{ env.VERSION }} \
&& nx build-image openchallenges-apex --configuration=ci"
16 changes: 13 additions & 3 deletions apps/openchallenges/apex/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,23 @@
"build-image": {
"executor": "@nx-tools/nx-container:build",
"options": {
"context": "apps/openchallenges/apex",
"context": "{projectRoot}",
"metadata": {
"images": ["ghcr.io/sage-bionetworks/openchallenges-apex"],
"images": ["ghcr.io/sage-bionetworks/{projectName}"],
"tags": ["type=edge,branch=main", "type=raw,value=local", "type=sha"]
},
"push": false
}
},
"configurations": {
"local": {},
"ci": {
"cache-from": ["type=gha"],
"cache-to": ["type=gha,mode=max"],
"push": true,
"tags": ["type=semver,pattern={{version}},value=${VERSION}", "type=sha"]
}
},
"defaultConfiguration": "local"
},
"publish-image": {
"executor": "@nx-tools/nx-container:build",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"@angular/language-service": "18.2.5",
"@chromatic-com/storybook": "2.0.2",
"@nrwl/js": "19.8.0",
"@nx-tools/container-metadata": "5.0.3",
"@nx-tools/nx-container": "5.0.3",
"@nx-tools/container-metadata": "6.0.2",
"@nx-tools/nx-container": "6.0.2",
"@nx/angular": "19.8.0",
"@nx/cypress": "19.8.0",
"@nx/devkit": "19.8.0",
Expand Down
Loading
Loading