tests: create docker image for tests #53
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
name: "Docker: Build and push to Docker Hub" | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set version tag | |
id: version | |
run: | | |
TAG=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) | |
echo "Using tag $TAG" | |
echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
target: runtime | |
tags: "sipgategmbh/li-simulator-x1x2x3:latest,sipgategmbh/li-simulator-x1x2x3:${{ steps.version.outputs.tag }}" | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
target: testtime | |
tags: "sipgategmbh/li-simulator-x1x2x3:latest-tests,sipgategmbh/li-simulator-x1x2x3:${{ steps.version.outputs.tag }}-tests" | |
- name: Docker Hub Description | |
uses: peter-evans/dockerhub-description@v4 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
short-description: ${{ github.event.repository.description }} | |
repository: sipgategmbh/li-simulator-x1x2x3 |