Skip to content

v1.21.0

v1.21.0 #90

name: Docker Build/Publish Release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
env:
DOCKER_REGISTRY: docker.io
DOCKER_IMAGE: lukasdotcom/fantasy-manager
DOCKER_TARGET_PLATFORM: linux/arm64,linux/amd64
steps:
- name: Checkout the code
uses: actions/checkout@v4
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Prepare
if: success()
id: prepare
run: |
echo "docker_platform=${DOCKER_TARGET_PLATFORM}" >> $GITHUB_OUTPUT
echo "docker_image=${DOCKER_REGISTRY}/${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
echo "version=${GITHUB_RUN_NUMBER}" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
if: success()
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Docker Login
if: success()
run: |
echo "${DOCKER_PAT}" | docker login ${DOCKER_REGISTRY} --username "${DOCKER_USERNAME}"
- name: Run Buildx (push image)
if: success()
run: |
docker buildx build --platform ${{ steps.prepare.outputs.docker_platform }} --tag ${{ steps.prepare.outputs.docker_image }}:latest --tag ${{ steps.prepare.outputs.docker_image }}:${{github.event.release.tag_name}} --tag ${{ steps.prepare.outputs.docker_image }}:1 --file ./Dockerfile --push .