Add Forgejo Actions CI to build & push the image
Some checks failed
build-and-push / docker (push) Failing after 53s

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>
This commit is contained in:
dlawler489 2026-06-22 17:00:49 +10:00
parent aabc0dd870
commit e5e1a2bfc1
3 changed files with 30 additions and 1 deletions

View file

@ -6,6 +6,7 @@ glb
data
.git
.gitignore
.forgejo
.env
*.log
.DS_Store

View file

@ -0,0 +1,28 @@
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}"

View file

@ -16,7 +16,7 @@ services:
app:
build: .
image: ghcr.io/dlawler489/printhive:latest
image: git.plexultra.com/dlawler489/printhive:latest
depends_on:
db:
condition: service_healthy