Skip to content

Release v1.1

Release v1.1 #5

Workflow file for this run

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name for the image (e.g. v1.0)'
required: true
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set tag name
id: set_tag
run: |
echo "TAG_NAME=${{ github.event.release.tag_name || inputs.tag_name }}" >> $GITHUB_ENV
- name: Build Docker image
run: |
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker build -t ghcr.io/$REPO:${{ env.TAG_NAME }} .
- name: Push Docker image
run: |
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker push ghcr.io/$REPO:${{ env.TAG_NAME }}
- name: Tag image as latest
run: |
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker tag ghcr.io/$REPO:${{ env.TAG_NAME }} ghcr.io/$REPO:latest
- name: Push latest tag
run: |
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker push ghcr.io/$REPO:latest