-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: demo-sl-spring | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
paths: | ||
- 'v-demo/demo-fs/fs-spring/**' | ||
|
||
env: | ||
WORKSPACE: 'v-demo/demo-fs/fs-spring' | ||
IMAGE_NAME: 'ghcr.io/lkzc19/demo-fs-spring' | ||
|
||
jobs: | ||
sl-spring-bulid: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: 'Set up JDK 17' | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
- name: 'Package gradle project' | ||
run: | | ||
cd ${{ env.WORKSPACE }} | ||
./gradlew bootJar | ||
- name: 'Set up Docker Buildx' | ||
uses: docker/setup-buildx-action@v2 | ||
- name: 'Login to GitHub Container Registry' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: 'Build and push docker image' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ${{ env.WORKSPACE }} | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
push: true | ||
tags: | | ||
${{ env.IMAGE_NAME }}:latest | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM bitnami/java:17 | ||
|
||
WORKDIR /app | ||
|
||
RUN mkdir /var/vitamin/file | ||
COPY ./build/libs/app.jar app.jar | ||
|
||
EXPOSE 3000 | ||
|
||
ENTRYPOINT ["java", "-Dspring.profiles.active=prod", "-jar", "app.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
v-demo/demo-fs/fs-spring/src/main/resources/application-prod.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
vitamin: | ||
fs-dir: /var/vitamin/file | ||
prefix: https://fs.drinkice.xyz/file |