From e5e1a2bfc1cff4c8d09a907efcd4a9f5b91df02c Mon Sep 17 00:00:00 2001 From: dlawler489 <104159223@student.swin.edu.au> Date: Mon, 22 Jun 2026 17:00:49 +1000 Subject: [PATCH] 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 :). 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 --- .dockerignore | 1 + .forgejo/workflows/build.yml | 28 ++++++++++++++++++++++++++++ docker-compose.yml | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/build.yml diff --git a/.dockerignore b/.dockerignore index 4db2a3c..ee63c18 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,7 @@ glb data .git .gitignore +.forgejo .env *.log .DS_Store diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml new file mode 100644 index 0000000..cdf37e9 --- /dev/null +++ b/.forgejo/workflows/build.yml @@ -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}" diff --git a/docker-compose.yml b/docker-compose.yml index 6c5a3fb..aefc7c8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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