v2024-12-22T16-35-00 #25
Workflow file for this run
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: Build and Push multi-arch Docker image | |
on: | |
release: | |
types: | |
- released | |
# - published | |
jobs: | |
build-publish-linux: | |
name: Build and Publish Containers (Linux) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set release version | |
run: | | |
echo "RELEASE_VERSION=$(echo '${{ github.event.release.tag_name }}' | sed -e s/^v//)" >> $GITHUB_ENV | |
- name: Print release version | |
run: | | |
echo ${{ env.RELEASE_VERSION }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and Push image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
file: linux/Dockerfile | |
platforms: linux/amd64,linux/arm64/8 | |
push: true | |
tags: gesellix/echo-server:${{ env.RELEASE_VERSION }}-linux | |
build-publish-windows: | |
name: Build and Publish Containers (Windows) | |
runs-on: windows-2022 | |
steps: | |
- name: Set release version | |
run: | | |
echo "RELEASE_VERSION=$(echo '${{ github.event.release.tag_name }}' | sed -e s/^v//)" | Out-File -FilePath $env:GITHUB_ENV -Append | |
- name: Print release version | |
run: | | |
echo ${{ env.RELEASE_VERSION }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker Build | |
run: | | |
docker build -f windows/Dockerfile -t gesellix/echo-server:${{ env.RELEASE_VERSION }}-windows . | |
- name: Docker Push | |
run: | | |
docker push gesellix/echo-server:${{ env.RELEASE_VERSION }}-windows | |
publish-manifest: | |
name: Publish Manifest | |
runs-on: ubuntu-latest | |
needs: | |
- build-publish-linux | |
- build-publish-windows | |
steps: | |
- name: Set release version | |
run: | | |
echo "RELEASE_VERSION=$(echo '${{ github.event.release.tag_name }}' | sed -e s/^v//)" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker Manifest | |
run: | | |
docker buildx imagetools create -t gesellix/echo-server:${{ env.RELEASE_VERSION }} \ | |
gesellix/echo-server:${{ env.RELEASE_VERSION }}-linux \ | |
gesellix/echo-server:${{ env.RELEASE_VERSION }}-windows | |
... |