familynido/.github/workflows/build-and-push.yml
dependabot[bot] 972d05158e
Some checks failed
Build and publish images / build (map[dockerfile:deploy/api.Dockerfile name:familynido-api]) (push) Has been cancelled
Build and publish images / build (map[dockerfile:deploy/web.Dockerfile name:familynido-web]) (push) Has been cancelled
E2E (Playwright) / playwright (push) Has been cancelled
Bump docker/build-push-action from 6 to 7 (#5)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6 to 7.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-05-13 00:56:14 +02:00

64 lines
1.8 KiB
YAML

name: Build and publish images
on:
push:
branches: [main]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAMESPACE: ${{ github.repository_owner }}
# Run JS-based actions on Node 24 — Node 20 is deprecated on GH-hosted
# runners (forced switch 2026-06-02, removal 2026-09-16). Opt in early
# so the warning goes away and we don't get caught flat-footed.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
image:
- name: familynido-api
dockerfile: deploy/api.Dockerfile
- name: familynido-web
dockerfile: deploy/web.Dockerfile
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.image.name }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,format=short
- name: Build and push ${{ matrix.image.name }}
uses: docker/build-push-action@v7
with:
context: .
file: ${{ matrix.image.dockerfile }}
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.image.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.image.name }}