Skip to content

Release Image to GHCR #9

Release Image to GHCR

Release Image to GHCR #9

Workflow file for this run

name: Release Image to GHCR
on:
workflow_dispatch:
inputs:
tag:
description: 'Image tag to release (e.g., v1.2.3, latest)'
required: true
default: latest
type: string
jobs:
release:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log into GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker image
id: build-and-push
env:
IMAGE_TAG: ${{ github.event.inputs.tag }}
# harcoding this because gh actions does not have a sane way to lowercase a string
GHCR_IMAGE: ghcr.io/moritzloewenstein/zentara/zentara:${{ github.event.inputs.tag }}
run: |
docker buildx build -t $GHCR_IMAGE .
docker push $GHCR_IMAGE