Skip to content

Commit

Permalink
chore(gha): add voting-admin-app docker image integration
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmorano committed Sep 18, 2023
1 parent af196ca commit e8c69d4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,30 @@ jobs:
"REACT_APP_USER_VERIFICATION_SERVER_URL=${{ env.REACT_APP_USER_VERIFICATION_SERVER_URL }}"
tags: |
${{ env.PRIVATE_DOCKER_REGISTRY_URL }}/${{ env.APP_NAME }}:${{ env.ARTIFACT_VERSION }}
publish-admin-cli:
runs-on: self-hosted
env:
APP_NAME: voting-admin-app
needs: build-version
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker Login
uses: docker/login-action@v2
with:
registry: ${{ env.PRIVATE_DOCKER_REGISTRY_URL }}
username: ${{ env.PRIVATE_DOCKER_REGISTRY_USER }}
password: ${{ env.PRIVATE_DOCKER_REGISTRY_PASS }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and Push docker image
uses: docker/build-push-action@v4
with:
context: backend-services/${{ env.APP_NAME }}
push: true
tags: |
${{ env.PRIVATE_DOCKER_REGISTRY_URL }}/${{ env.APP_NAME }}:${{ env.ARTIFACT_VERSION }}
9 changes: 9 additions & 0 deletions backend-services/voting-admin-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM openjdk:20-jdk-slim AS build
WORKDIR /app
COPY . /app
RUN ./gradlew clean build

FROM openjdk:20-jdk-slim AS runtime
WORKDIR /app
COPY --from=build /app/build/libs/*SNAPSHOT.jar /app/app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]

0 comments on commit e8c69d4

Please sign in to comment.