Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Docker Image CI

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
workflow_dispatch:
inputs:
tag:
description: "Version tag to use for the Docker image"
required: true

jobs:
build-and-push:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Log in to GitHub Packages
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Lower case docker image name
id: docker_image
uses: ASzc/change-string-case-action@v8
with:
string: ${{ github.repository }}

- name: Build and push latest
uses: docker/build-push-action@v7
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ steps.docker_image.outputs.lowercase }}:latest

- name: Build and push version tag
uses: docker/build-push-action@v7
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ steps.docker_image.outputs.lowercase }}:${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }}
Loading