Files
docker-compose-docker/.gitea/workflows/release.yaml

141 lines
4.9 KiB
YAML

name: Release
on:
push:
tags:
- "**"
repository_dispatch:
types: [ push-tagged-images ]
jobs:
push-arm64:
runs-on: ubuntu-latest-arm64
steps:
- id: version_extraction
name: Extract git tag
run: |
VERSION="${{ github.event.client_payload.tag || github.ref_name }}"
VERSION="${VERSION#refs/*/}"
echo "Version: ${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v5.0.0
with:
fetch-tags: true
ref: "${{ steps.version_extraction.outputs.version }}"
- uses: docker/setup-qemu-action@v3.6.0
- uses: docker/setup-buildx-action@v3.11.1
- uses: docker/login-action@v3.6.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- name: Build and push image
run: |
docker buildx build \
--build-arg GONOSUMDB=${GONOSUMDB} \
--build-arg GOPRIVATE=${GOPRIVATE} \
--build-arg GOPROXY=${GOPROXY} \
--platform linux/arm64 \
--file Dockerfile \
--provenance false \
--tag git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}-arm64 \
--push \
.
push-amd64:
runs-on: ubuntu-latest-amd64
steps:
- id: version_extraction
name: Extract git tag
run: |
VERSION="${{ github.event.client_payload.tag || github.ref_name }}"
VERSION="${VERSION#refs/*/}"
echo "Version: ${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v5.0.0
with:
fetch-tags: true
ref: "${{ steps.version_extraction.outputs.version }}"
- uses: docker/setup-qemu-action@v3.6.0
- uses: docker/setup-buildx-action@v3.11.1
- uses: docker/login-action@v3.6.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- name: Build and push image
run: |
docker buildx build \
--build-arg GONOSUMDB=${GONOSUMDB} \
--build-arg GOPRIVATE=${GOPRIVATE} \
--build-arg GOPROXY=${GOPROXY} \
--platform linux/amd64 \
--file Dockerfile \
--provenance false \
--tag git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}-amd64 \
--push \
.
push-manifest:
runs-on: ubuntu-latest
needs:
- push-arm64
- push-amd64
steps:
- id: version_extraction
name: Extract git tag
run: |
VERSION="${{ github.event.client_payload.tag || github.ref_name }}"
VERSION="${VERSION#refs/*/}"
echo "Version: ${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- uses: docker/login-action@v3.6.0
with:
registry: git.cryptic.systems
username: ${{ github.repository_owner }}
password: ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }}
- name: Create and push manifest
run: |
docker manifest create git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }} \
--amend git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}-amd64 \
--amend git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}-arm64
docker manifest push git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }}
sync-to-hub-docker-io:
needs:
- push-manifest
runs-on: ubuntu-latest
steps:
- id: version_extraction
name: Extract git tag
run: |
VERSION="${{ github.event.client_payload.tag || github.ref_name }}"
VERSION="${VERSION#refs/*/}"
echo "Version: ${VERSION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
- name: Copy images to docker.io
run: |
TAG=$(echo ${{ github.ref_name }} | sed 's/v//gm')
apt-get update --yes
apt-get install --yes skopeo
skopeo copy \
--all \
--dest-password ${{ secrets.DOCKER_IO_PASSWORD }} \
--dest-username ${{ secrets.DOCKER_IO_USERNAME }} \
--src-password ${{ secrets.GIT_CRYPTIC_SYSTEMS_PACKAGE_REGISTRY_TOKEN }} \
--src-username volker.raschek \
docker://git.cryptic.systems/volker.raschek/docker-compose:${{ steps.version_extraction.outputs.version }} \
docker://docker.io/volkerraschek/docker-compose:${{ steps.version_extraction.outputs.version }}