pokerface/.forgejo/workflows/build-push.yml
Jan Willem Mannaerts 620547c78c
All checks were successful
Build & Push Container Image / build (push) Successful in 15s
Add Forgejo CI/CD workflow for Docker build & push
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 21:21:48 +01:00

28 lines
786 B
YAML

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"