mirror of
https://github.com/ChrispyBacon-dev/DockFlare.git
synced 2026-04-28 11:49:34 +00:00
84 lines
No EOL
3.1 KiB
YAML
84 lines
No EOL
3.1 KiB
YAML
# DockFlare: Automates Cloudflare Tunnel ingress from Docker labels.
|
|
# Copyright (C) 2025 ChrispyBacon-Dev <https://github.com/ChrispyBacon-dev/DockFlare>
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
# .github/workflows/docker-build.yml
|
|
name: Docker Image Build and Push (Conditional Arch)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "stable"
|
|
- "unstable"
|
|
pull_request:
|
|
branches:
|
|
- "stable"
|
|
# - "unstable" # Optional: Decide if PRs to nightly should trigger
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # Fetches all history and tags, necessary for semver tag detection
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: alplat/dockflare # Your Docker image 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 (Multi-Arch)
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./dockflare
|
|
# Build for multiple architectures
|
|
platforms: linux/amd64 #,linux/arm64 # Enable multi-architecture builds
|
|
# Push only on direct pushes to stable or unstable branches
|
|
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 |