Skip to content

Commit bf43720

Browse files
committed
build check
1 parent 7bdee4f commit bf43720

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ jobs:
2626
run: mvn clean install
2727

2828
- name: Build Docker image
29-
run: docker build -t spring-jwt-auth .
29+
env:
30+
SPRING_DATASOURCE_URL: ${{ secrets.SPRING_DATASOURCE_URL }}
31+
run: docker build --build-arg SPRING_DATASOURCE_URL=${{ secrets.SPRING_DATASOURCE_URL }} -t spring-jwt-auth .
3032

3133
- name: Log in to Docker Hub
3234
uses: docker/login-action@v2

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ FROM openjdk:21-jdk
44
# Set the working directory inside the container
55
WORKDIR /app
66

7+
# Accept an argument for the datasource URL
8+
ARG SPRING_DATASOURCE_URL
9+
10+
# Set the environment variable
11+
ENV SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL}
12+
713
# Copy the project's jar file into the container at /app
814
COPY target/*.jar app.jar
915

0 commit comments

Comments
 (0)