77 lines
2.5 KiB
YAML
77 lines
2.5 KiB
YAML
name: Build and Push Dashboard
|
|
|
|
on:
|
|
push:
|
|
branches: ["*"]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
REGISTRY: git.zias.be
|
|
OWNER: zias
|
|
|
|
jobs:
|
|
build-dashboard:
|
|
runs-on: ubuntu-latest
|
|
# FIX: The build takes ~1h54min and the default runner timeout is 2h —
|
|
# extend to 6h so the push step has time to complete.
|
|
timeout-minutes: 360
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
# FIX: Use driver: docker instead of the default docker-container driver.
|
|
# The container driver has a hardcoded ~2h BuildKit gRPC session timeout.
|
|
# On this ARM64 runner the dashboard build takes ~1h54min, leaving too
|
|
# little time for the push before the session dies. The docker driver
|
|
# uses the host daemon's built-in BuildKit — no external session, no
|
|
# 2-hour timeout, and the daemon's layer cache persists between runs.
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver: docker
|
|
|
|
- name: Log in to registry
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ env.OWNER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.OWNER }}/openpanel-dashboard
|
|
tags: |
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
type=sha,prefix=sha-,format=short
|
|
type=semver,pattern={{version}}
|
|
|
|
# With driver: docker, images are built into the local daemon — no
|
|
# push during the build. Cache is provided automatically by the daemon's
|
|
# local BuildKit store (persists between runs via the shared Docker socket).
|
|
- name: Build image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: apps/start/Dockerfile
|
|
target: runner
|
|
platforms: linux/amd64
|
|
push: false
|
|
load: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
provenance: false
|
|
|
|
- name: Push image
|
|
if: github.event_name != 'pull_request'
|
|
run: |-
|
|
while IFS= read -r tag; do
|
|
[ -n "$tag" ] && docker push "$tag"
|
|
done <<< "${{ steps.meta.outputs.tags }}"
|