Update compose + CI for CasaOS deploy; build both images in CI
docker-compose.yml:
- Remove env_file — all vars inline with \${VAR:-default} substitution
- NTFY_TOPIC soft-defaults to empty (no hard :? error)
- Pull pre-built images from ghcr.io (no local build step)
- Add resource limits: app 512MB/1CPU, notifier 128MB/0.25CPU
- Add x-casaos metadata for CasaOS app store / dashboard
- Remove dev service (run separately as needed)
.github/workflows/docker.yml:
- Build and push both app (ghcr.io/nmemmert/letter) and notifier
(ghcr.io/nmemmert/letter-notifier) images in one job
- Separate GHA cache scopes per image for efficient layer reuse
- Separate metadata steps for independent tag sets
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
0eb625c188
commit
fc3bae40da
2 files changed
+71
-66
No files matched your search
@@ -7,11 +7,12 @@ on:
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
APP_IMAGE: ghcr.io/nmemmert/letter
|
||||
NOTIFIER_IMAGE: ghcr.io/nmemmert/letter-notifier
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Build & push image
|
||||
name: Build & push images
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -30,23 +31,44 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags & labels)
|
||||
id: meta
|
||||
- name: Extract metadata — app
|
||||
id: meta-app
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
images: ${{ env.APP_IMAGE }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha,prefix=sha-,format=short
|
||||
|
||||
- name: Build and push
|
||||
- name: Extract metadata — notifier
|
||||
id: meta-notifier
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.NOTIFIER_IMAGE }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha,prefix=sha-,format=short
|
||||
|
||||
- name: Build and push — app
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
tags: ${{ steps.meta-app.outputs.tags }}
|
||||
labels: ${{ steps.meta-app.outputs.labels }}
|
||||
cache-from: type=gha,scope=app
|
||||
cache-to: type=gha,mode=max,scope=app
|
||||
|
||||
- name: Build and push — notifier
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./notifier
|
||||
push: true
|
||||
tags: ${{ steps.meta-notifier.outputs.tags }}
|
||||
labels: ${{ steps.meta-notifier.outputs.labels }}
|
||||
cache-from: type=gha,scope=notifier
|
||||
cache-to: type=gha,mode=max,scope=notifier
|
||||
Reference in new issue
Block a user