Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Root cause of 6+ min builds: Dockerfile stage 1 ran 'npm install' with no package-lock.json, so every build re-resolved + re-fetched the full npm tree from scratch on a fresh runner. - Dockerfile: replace node:22-slim+npm stage with oven/bun:1-slim; both stages now 'bun install --frozen-lockfile' against the tracked bun.lock; --mount=type=cache for the bun install cache - workflow: switch to docker/build-push-action with registry buildcache (cache-from + cache-to) so layers persist across runs - dockerignore: add .worktrees, docs, tests, tsbuildinfo so the build context ships less
37 lines
1.1 KiB
YAML
37 lines
1.1 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
env:
|
|
REGISTRY: git.felixfoertsch.de
|
|
IMAGE: felixfoertsch/netfelix-audio-fix
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "$REGISTRY" -u "${{ github.actor }}" --password-stdin
|
|
|
|
- name: Extract version from package.json
|
|
id: meta
|
|
run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
|
|
${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ steps.meta.outputs.version }}
|
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE }}:buildcache
|
|
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE }}:buildcache,mode=max
|