63 lines
1.6 KiB
YAML
63 lines
1.6 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
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- 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}}
|
|
|
|
- name: Build
|
|
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
|
|
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/openpanel-dashboard:latest
|
|
|
|
- name: Push
|
|
if: github.event_name != 'pull_request'
|
|
run: |
|
|
echo "${{ steps.meta.outputs.tags }}" | while IFS= read -r tag; do
|
|
docker push "$tag"
|
|
done
|