Skip to content

Daily Build from Fork (release-candidate) #31

Daily Build from Fork (release-candidate)

Daily Build from Fork (release-candidate) #31

name: Daily Build from Fork (release-candidate)
on:
schedule:
- cron: '0 0 * * *' # Runs every 24 hours at 00:00 UTC
workflow_dispatch: # Allows you to click "Run workflow" manually
env:
DOCKERHUB_USERNAME: 00jlich
DOCKER_HUB_REPO: abs-kosync-bridge
FORK_REPOSITORY: cporcellijr/abs-kosync-bridge
permissions:
contents: read
packages: write
jobs:
docker:
runs-on: ubuntu-latest
steps:
# 1. Checkout the specific branch from the FORK
- name: Checkout Fork repository
uses: actions/checkout@v4
with:
repository: ${{ env.FORK_REPOSITORY }}
ref: main
fetch-depth: 1
# 2. Tagging Strategy for Branch Builds
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_USERNAME }}/${{ env.DOCKER_HUB_REPO }}
ghcr.io/${{ github.repository }}
tags: |
# Fixed tag for the branch to be enhanced verision
type=raw,value=version
# Date-based tag to keep history (e.g., release-candidate-20240101)
type=schedule,pattern=release-candidate-{{date 'YYYYMMDD'}}
# Use SHA for precise tracking
type=sha
# Uncomment below if you want this branch to overwrite 'latest'
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Login to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
# Always push since we are running on a schedule
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max