mirror of
https://github.com/the-draupnir-project/Draupnir.git
synced 2026-03-29 10:29:57 +00:00
* GHCR Separate Workflows * GHCR Standalone Publishing Refinements * Docker Hub Publishing Refinements * Add Development Build Artefact Generation and Publishing This only runs against non Excluded branches as to be practical. * Fix GHCR Deployment due to Uppercase Names and Main Branch Exclusion * Fix Github ignoring Branch filters for Develop Workflow * Harmonise Development Artifact Workflows * Improve Docker Hub Development Artefact Metadata
68 lines
2.0 KiB
YAML
68 lines
2.0 KiB
YAML
# SPDX-FileCopyrightText: 2024 Gnuxie <Gnuxie@protonmail.com>
|
|
# SPDX-FileCopyrightText: 2026 Catalan Lover <catalanlover@protonmail.com>
|
|
#
|
|
# SPDX-License-Identifier: CC0-1.0
|
|
|
|
# Copied from https://github.com/matrix-org/matrix-bifrost/blob/develop/.github/workflows/docker-hub-latest.yml
|
|
|
|
name: "Docker Hub - Develop"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
DOCKER_NAMESPACE: gnuxie
|
|
PLATFORMS: linux/amd64,linux/arm64
|
|
# Only push if this is main, otherwise we just want to build
|
|
PUSH: ${{ github.ref == 'refs/heads/main' }}
|
|
IMG_SOURCE: https://github.com/${{ github.repository }}
|
|
|
|
jobs:
|
|
docker-latest:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
packages: write
|
|
contents: read
|
|
attestations: write
|
|
steps:
|
|
- name: Check out
|
|
uses: actions/checkout@v4
|
|
- name: Unshallow for git describe so we can create version.txt
|
|
run: git fetch --prune --unshallow --tags --all --force
|
|
|
|
# Needed for multi platform builds
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
with:
|
|
platforms: ${{ env.PLATFORMS }}
|
|
|
|
- name: Set up Docker 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: Build image
|
|
id: push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: ${{ env.PLATFORMS }}
|
|
push: ${{ env.PUSH }}
|
|
labels: |
|
|
org.opencontainers.image.source=${{ env.IMG_SOURCE }}
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
org.opencontainers.image.version=${{ github.ref_name }}-${{ github.sha }}
|
|
org.opencontainers.image.ref.name=${{ github.ref_name }}
|
|
org.opencontainers.image.licenses=AFL-3.0
|
|
sbom: true
|
|
tags: |
|
|
${{ env.DOCKER_NAMESPACE }}/draupnir:develop
|