Skip to content

Tag docker image with legacy #115

Tag docker image with legacy

Tag docker image with legacy #115

Workflow file for this run

name: Build and Push Docker Image
on:
workflow_dispatch:
push:
branches: [main]
tags: 'v*.*.*'
jobs:
build:
name: 'Build and Push Docker Image'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Tags
id: tags
run: |
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
VERSION=${GITHUB_REF##*/}
if [[ $VERSION == main ]]; then
VERSION=latest
fi
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${GITHUB_RUN_ID},${DOCKER_IMAGE}:legacy"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ steps.tags.outputs.tags }}