-
Notifications
You must be signed in to change notification settings - Fork 2
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
5 changed files
with
79 additions
and
82 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,55 @@ | ||
name: Build docker | ||
description: Builds and push docker image | ||
|
||
outputs: | ||
image_name: | ||
description: Image name | ||
value: ${{ steps.set_outputs.outputs.image_name }} | ||
image_tag: | ||
description: Image tag | ||
value: ${{ steps.set_outputs.outputs.new_tag }} | ||
image_digest: | ||
description: Image digest | ||
value: ${{ steps.set_outputs.outputs.new_digest }} | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Login to Github Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.registry }} | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/github-tag-action@v6.2 | ||
with: | ||
github_token: ${{ github.token }} | ||
|
||
- name: Build docker and push | ||
id: build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ env.registry }}/${{ github.repository }}:${{ steps.tag_version.outputs.new_tag }} , ${{ env.registry }}/${{ github.repository }}:latest | ||
|
||
- name: Set outputs | ||
id: set_outputs | ||
shell: bash | ||
run: | | ||
echo 'image_name=${{ env.registry }}/${{ github.repository }}' >> $GITHUB_OUTPUT | ||
echo 'new_digest=${{ steps.build.outputs.digest }}' >> $GITHUB_OUTPUT | ||
echo 'new_tag=${{ steps.tag_version.outputs.new_tag }}' >> $GITHUB_OUTPUT | ||
- name: Add summary of build | ||
id: summary | ||
shell: bash | ||
run: | | ||
echo '### Image release info' >> $GITHUB_STEP_SUMMARY | ||
echo '- Image name: ${{ env.registry }}/${{ github.repository }}' >> $GITHUB_STEP_SUMMARY | ||
echo '- Digest: ${{ steps.build.outputs.digest }}' >> $GITHUB_STEP_SUMMARY | ||
echo '- Tag: ${{ steps.tag_version.outputs.new_tag }}' >> $GITHUB_STEP_SUMMARY |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,5 @@ | ||
FROM gradle:8-jdk21-alpine AS build | ||
COPY --chown=gradle:gradle . /home/gradle/src | ||
WORKDIR /home/gradle/src | ||
RUN gradle integrationTest shadowjar --no-daemon | ||
|
||
FROM eclipse-temurin:21-jdk-alpine | ||
EXPOSE 8080:8080 | ||
RUN mkdir /app | ||
COPY --from=build /home/gradle/src/build/libs/*.jar /app/matrikkel-bygning-egenregistrering.jar | ||
ENTRYPOINT ["java", "-Dlogback.configurationFile=logback-cloud.xml", "-jar","/app/matrikkel-bygning-egenregistrering.jar"] | ||
COPY /build/libs/matrikkel-bygning-egenregistrering-all.jar /app/app.jar | ||
ENTRYPOINT ["java", "-Dlogback.configurationFile=logback-cloud.xml", "-jar","/app/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