Skip to content

Commit 4365cad

Browse files
authored
Merge pull request #725 from ossuminc/development
Fix Docker build credentials for sbt-ossuminc
2 parents 511ff94 + 8e39428 commit 4365cad

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ jobs:
6464
push: true
6565
tags: ${{ steps.meta.outputs.tags }}
6666
labels: ${{ steps.meta.outputs.labels }}
67+
build-args: |
68+
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
6769
cache-from: type=gha
6870
cache-to: type=gha,mode=max
6971

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,28 @@ RUN curl -fsSL https://github.com/sbt/sbt/releases/download/v1.10.7/sbt-1.10.7.t
1212
tar xz -C /opt && \
1313
ln -s /opt/sbt/bin/sbt /usr/local/bin/sbt
1414

15+
# GitHub Packages credentials for sbt-ossuminc plugin
16+
ARG GITHUB_TOKEN
17+
1518
# Set working directory
1619
WORKDIR /app
1720

21+
# Configure sbt GitHub Packages credentials
22+
RUN mkdir -p /root/.sbt/1.0 && \
23+
echo 'credentials += Credentials("GitHub Package Registry", "maven.pkg.github.com", "x-access-token", sys.env.getOrElse("GITHUB_TOKEN", ""))' > /root/.sbt/1.0/github.sbt
24+
1825
# Copy project files for sbt dependency resolution (cached layer)
1926
COPY project/build.properties project/plugins.sbt project/Dependencies.scala project/
2027
COPY build.sbt ./
2128

2229
# Pre-fetch dependencies (this layer is cached if build files don't change)
23-
RUN sbt --batch update
30+
RUN GITHUB_TOKEN=${GITHUB_TOKEN} sbt --batch update
2431

2532
# Copy source code
2633
COPY . .
2734

2835
# Build the universal package
29-
RUN sbt --batch riddlc/Universal/stage
36+
RUN GITHUB_TOKEN=${GITHUB_TOKEN} sbt --batch riddlc/Universal/stage
3037

3138
# Stage 2: Create custom JRE with jlink
3239
FROM eclipse-temurin:25-jdk-alpine AS jre-builder

0 commit comments

Comments
 (0)