Deploy Docker Image #13
This file contains hidden or 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
name: Deploy Docker Image | |
on: | |
workflow_run: | |
workflows: | |
- 'Bump version' | |
types: | |
- completed | |
jobs: | |
build_and_push: | |
runs-on: ubuntu-24.04-arm | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
username: tutorialwork | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'liberica' | |
java-version: '21' | |
- name: Get Maven project version | |
run: | | |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
echo "Project Maven Version: $VERSION" | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Build JAR with Maven | |
run: mvn clean package -DskipTests | |
- name: Build & Push Multi Arch Docker Image | |
run: | | |
docker buildx build --platform linux/amd64,linux/arm64 \ | |
-t tutorialwork/kleinanzeigen-ads-renewer:${{ env.VERSION }} \ | |
-t tutorialwork/kleinanzeigen-ads-renewer:latest \ | |
--push . |