Add Forgejo Actions CI to build & push the image
Some checks failed
build-and-push / docker (push) Failing after 53s
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:
parent
aabc0dd870
commit
e5e1a2bfc1
3 changed files with 30 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ glb
|
||||||
data
|
data
|
||||||
.git
|
.git
|
||||||
.gitignore
|
.gitignore
|
||||||
|
.forgejo
|
||||||
.env
|
.env
|
||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
|
||||||
28
.forgejo/workflows/build.yml
Normal file
28
.forgejo/workflows/build.yml
Normal 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}"
|
||||||
|
|
@ -16,7 +16,7 @@ services:
|
||||||
|
|
||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
image: ghcr.io/dlawler489/printhive:latest
|
image: git.plexultra.com/dlawler489/printhive:latest
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue