Skip to content
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
24 changes: 18 additions & 6 deletions .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This workflow will perform following actions when code is pushed to the main branch:
# - Run tests and linting checks (can be enabled via needs: test_and_lint)
# - Build and push nmrKit Docker image with layer caching for faster builds
# - Build and push nmrKit Docker image with latest and release-version tags
# - Conditionally build nmr-cli image only if files in app/scripts/nmr-cli/ changed
# - Push images to Docker Hub under namespace nfdi4chem with latest tag
# - Push images to Docker Hub under namespace nfdi4chem with latest tags (plus release-version tags)
# - Prevent redundant builds using concurrency control
#
# Maintainers:
Expand Down Expand Up @@ -93,15 +93,25 @@ jobs:
nmr-cli:
- 'app/scripts/nmr-cli/**'

# Fetch the latest GitHub release tag for versioned Docker tags
- name: Get latest release version
id: release_version
uses: pozetroninc/github-action-get-latest-release@v0.8.0
with:
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}

# Build main nmrKit image with registry caching for faster builds
- name: Build and push nmrKit Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
build-args: RELEASE_VERSION=${{ env.RELEASE_TAG }}
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }}
build-args: RELEASE_VERSION=${{ steps.release_version.outputs.release }}
tags: |
${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }}
${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:${{ steps.release_version.outputs.release }}
cache-from: type=registry,ref=${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMRKIT_REPOSITORY_NAME }}:buildcache,mode=max

Expand All @@ -113,7 +123,9 @@ jobs:
context: ./app/scripts/nmr-cli/
file: ./app/scripts/nmr-cli/Dockerfile
push: true
build-args: RELEASE_VERSION=${{ env.RELEASE_TAG }}
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }}
build-args: RELEASE_VERSION=${{ steps.release_version.outputs.release }}
tags: |
${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:${{ env.RELEASE_TAG }}
${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:${{ steps.release_version.outputs.release }}
cache-from: type=registry,ref=${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REPOSITORY_NAMESPACE }}/${{ env.NMR_CLI_REPOSITORY_NAME }}:buildcache,mode=max
4 changes: 4 additions & 0 deletions app/scripts/nmr-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ WORKDIR /app
ENV BASE_NMRIUM_URL=https://nmriumdev.nmrxiv.org/
ENV NMR_PREDICTION_URL=https://nmrshiftdb.nmr.uni-koeln.de/NmrshiftdbServlet/nmrshiftdbaction/quickcheck

# Override at runtime with: docker run -e NODE_OPTIONS="--max-old-space-size=<MB>" ...
ARG NODE_MAX_OLD_SPACE_SIZE=12288
ENV NODE_OPTIONS=--max-old-space-size=${NODE_MAX_OLD_SPACE_SIZE}

# Install Java (OpenJDK 17 for Ubuntu Noble)
RUN apt-get update && \
apt-get install -y --no-install-recommends openjdk-17-jre && \
Expand Down
Loading