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
56 changes: 56 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Container Next

on:
push:
tags:
- '*'
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to ghcr.io
run: podman login --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }}

- name: Extract metadata
id: meta
run: |
# Extract tag name or use 'latest' for main branch
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION=latest
fi

IMAGE_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${VERSION}"
echo "tags=${IMAGE_TAG}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT

- name: Build container image
run: |
podman build \
--tag ${{ steps.meta.outputs.tags }} \
--file Dockerfile \
.

- name: Push container image
run: |
podman push ${{ steps.meta.outputs.tags }}

- name: Output image details
run: |
echo "Image pushed: ${{ steps.meta.outputs.tags }}"
echo "Version: ${{ steps.meta.outputs.version }}"