Add Forgejo CI/CD workflow for Docker build & push
All checks were successful
Build & Push Container Image / build (push) Successful in 15s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jan Willem Mannaerts 2026-02-27 21:21:48 +01:00
parent fdd9ba8d56
commit 620547c78c

View file

@ -0,0 +1,28 @@
name: Build & Push Container Image
on:
push:
branches: [main]
env:
REGISTRY: git.faralmail.com
IMAGE_PREFIX: faral
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Short SHA
run: echo "SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> "$GITHUB_ENV"
- name: Login to Forgejo Registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login $REGISTRY -u ${{ github.repository_owner }} --password-stdin
- name: Build and push
run: |
TAG="${REGISTRY}/${IMAGE_PREFIX}/pokerface"
docker build -t "${TAG}:${{ github.run_number }}-${SHORT_SHA}" -t "${TAG}:latest" .
docker push "${TAG}:${{ github.run_number }}-${SHORT_SHA}"
docker push "${TAG}:latest"