printhive/.forgejo/workflows/build.yml
dlawler489 e5e1a2bfc1
Some checks failed
build-and-push / docker (push) Failing after 53s
Add Forgejo Actions CI to build & push the image
On push to main (and v* tags), builds the Docker image and pushes it to
the Forgejo container registry at git.plexultra.com/dlawler489/printhive
(:latest and :<short-sha>). Uses the auto-provided Actions token with
packages:write; plain docker CLI so it only needs the checkout action.
Compose image reference updated to the Forgejo registry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:00:49 +10:00

28 lines
707 B
YAML

name: build-and-push
on:
push:
branches: [main]
tags: ['v*']
permissions:
contents: read
packages: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to the Forgejo container registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login git.plexultra.com -u "${{ github.actor }}" --password-stdin
- name: Build and push image
run: |
IMAGE="git.plexultra.com/${{ github.repository }}"
SHA="${{ github.sha }}"
docker build -t "$IMAGE:latest" -t "$IMAGE:${SHA:0:12}" .
docker push "$IMAGE:latest"
docker push "$IMAGE:${SHA:0:12}"