Enhance Dockerfile and workflow for multi-architecture support and dynamic cloudflared installation

This commit is contained in:
martadams89 2025-04-19 11:37:14 +01:00
parent 5538e792cf
commit 9671332597
3 changed files with 21 additions and 34 deletions

View file

@ -38,32 +38,18 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: alplat/dockflare # Your Docker image name
images: ${{ github.repository }} # Dynamically use the repository owner and name
tags: |
# --- ADDED THIS LINE ---
# Create Docker tag from Git SemVer tags (e.g., v1.3.0 -> 1.3.0)
type=semver,pattern={{version}}
# --- Keep existing rules ---
# Create 'latest' tag for stable branch pushes
type=ref,event=branch,pattern=stable,value=latest
# Create 'unstable' tag for unstable branch pushes
type=ref,event=branch,pattern=unstable,value=unstable
# Create tag based on short commit SHA
type=sha,format=short
- name: Build and Push Docker Image (Conditional Arch)
- name: Build and Push Docker Image (Multi-Arch)
uses: docker/build-push-action@v5
with:
context: .
# Build multi-arch only for stable, otherwise just amd64
platforms: linux/amd64
# Push only on direct pushes to stable or unstable branches
platforms: linux/amd64,linux/arm64 # Enable multi-architecture builds
push: ${{ github.event_name == 'push' && (github.ref_name == 'stable' || github.ref_name == 'unstable') }}
# Use all tags generated by the metadata action
tags: ${{ steps.meta.outputs.tags }}
# Use labels generated by the metadata action
labels: ${{ steps.meta.outputs.labels }}
# Consider enabling caching once it works
# cache-from: type=gha
# cache-to: type=gha,mode=max