File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 26
26
run : mvn clean install
27
27
28
28
- 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 .
30
32
31
33
- name : Log in to Docker Hub
32
34
uses : docker/login-action@v2
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ FROM openjdk:21-jdk
4
4
# Set the working directory inside the container
5
5
WORKDIR /app
6
6
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
+
7
13
# Copy the project's jar file into the container at /app
8
14
COPY target/*.jar app.jar
9
15
You can’t perform that action at this time.
0 commit comments