Docker: Publish master image #253
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Docker: Publish master image' | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'doc/**' | |
- 'docker-k8s/pkgrel' | |
- 'docker-k8s/examples/**' | |
- 'scripts/get-version' | |
- 'windows/**' | |
- '**.md' | |
schedule: | |
# Build the image regularly (every Sunday) to keep packages up-to-date. | |
- cron: '22 22 * * 0' | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
# DOCKERHUB_REPO: processone/eturnal | |
jobs: | |
build-x86-64: | |
name: x86-64 - Build & publish image from master branch | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - | |
# name: Extract inofficial tag | |
# run: | | |
# echo "TAG_VERSION=$(echo "$(git describe --tags)" | sed -e 's/-g.*//')" >> $GITHUB_ENV | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# ${{ env.DOCKERHUB_REPO }} | |
tags: | | |
edge-x86-64 | |
# ${{ env.TAG_VERSION }}-x86-64 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - | |
# name: Log in to DockerHub | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: | | |
VERSION=master | |
REPOSITORY=https://github.com/${{ github.repository }}.git | |
context: docker-k8s/image/. | |
platforms: linux/amd64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-i386: | |
name: i386 - Build & publish image from master branch | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - | |
# name: Extract inofficial tag | |
# run: | | |
# echo "TAG_VERSION=$(echo "$(git describe --tags)" | sed -e 's/-g.*//')" >> $GITHUB_ENV | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# ${{ env.DOCKERHUB_REPO }} | |
tags: | | |
edge-i386 | |
# ${{ env.TAG_VERSION }}-i386 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - | |
# name: Log in to DockerHub | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: | | |
VERSION=master | |
REPOSITORY=https://github.com/${{ github.repository }}.git | |
context: docker-k8s/image/. | |
platforms: linux/386 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-aarch64: | |
name: aarch64 - Build & publish image from master branch | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - | |
# name: Extract inofficial tag | |
# run: | | |
# echo "TAG_VERSION=$(echo "$(git describe --tags)" | sed -e 's/-g.*//')" >> $GITHUB_ENV | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# ${{ env.DOCKERHUB_REPO }} | |
tags: | | |
edge-aarch64 | |
# ${{ env.TAG_VERSION }}-aarch64 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - | |
# name: Log in to DockerHub | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: | | |
VERSION=master | |
REPOSITORY=https://github.com/${{ github.repository }}.git | |
context: docker-k8s/image/. | |
platforms: linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-armv7: | |
name: armv7 - Build & publish image from master branch | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - | |
# name: Extract inofficial tag | |
# run: | | |
# echo "TAG_VERSION=$(echo "$(git describe --tags)" | sed -e 's/-g.*//')" >> $GITHUB_ENV | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# ${{ env.DOCKERHUB_REPO }} | |
tags: | | |
edge-armv7 | |
# ${{ env.TAG_VERSION }}-armv7 | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - | |
# name: Log in to DockerHub | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: | | |
VERSION=master | |
REPOSITORY=https://github.com/${{ github.repository }}.git | |
context: docker-k8s/image/. | |
platforms: linux/arm/v7 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-armhf: | |
name: armhf - Build & publish image from master branch | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - | |
# name: Extract inofficial tag | |
# run: | | |
# echo "TAG_VERSION=$(echo "$(git describe --tags)" | sed -e 's/-g.*//')" >> $GITHUB_ENV | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# ${{ env.DOCKERHUB_REPO }} | |
tags: | | |
edge-armhf | |
# ${{ env.TAG_VERSION }}-armhf | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - | |
# name: Log in to DockerHub | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: | | |
VERSION=master | |
REPOSITORY=https://github.com/${{ github.repository }}.git | |
context: docker-k8s/image/. | |
platforms: linux/arm/v6 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-ppc64le: | |
name: ppc64le - Build & publish image from master branch | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - | |
# name: Extract inofficial tag | |
# run: | | |
# echo "TAG_VERSION=$(echo "$(git describe --tags)" | sed -e 's/-g.*//')" >> $GITHUB_ENV | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# ${{ env.DOCKERHUB_REPO }} | |
tags: | | |
edge-ppc64le | |
# ${{ env.TAG_VERSION }}-ppc64le | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - | |
# name: Log in to DockerHub | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: | | |
VERSION=master | |
REPOSITORY=https://github.com/${{ github.repository }}.git | |
context: docker-k8s/image/. | |
platforms: linux/ppc64le | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-s390x: | |
name: s390x - Build & publish image from master branch | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - | |
# name: Extract inofficial tag | |
# run: | | |
# echo "TAG_VERSION=$(echo "$(git describe --tags)" | sed -e 's/-g.*//')" >> $GITHUB_ENV | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
# ${{ env.DOCKERHUB_REPO }} | |
tags: | | |
edge-s390x | |
# ${{ env.TAG_VERSION }}-s390x | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - | |
# name: Log in to DockerHub | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
build-args: | | |
VERSION=master | |
REPOSITORY=https://github.com/${{ github.repository }}.git | |
context: docker-k8s/image/. | |
platforms: linux/s390x | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
publish-manifest: | |
name: Publish image manifest | |
runs-on: ubuntu-latest | |
needs: [build-x86-64, build-i386, build-aarch64, build-armv7, build-armhf, build-ppc64le, build-s390x] | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 | |
# - | |
# name: Extract inofficial tag | |
# run: | | |
# echo "TAG_VERSION=$(echo "$(git describe --tags)" | sed -e 's/-g.*//')" >> $GITHUB_ENV | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- | |
name: Log in to GHCR | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# - | |
# name: Log in to DockerHub | |
# if: github.event_name != 'pull_request' | |
# uses: docker/login-action@v2 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- | |
name: Merge and publish | |
run: | | |
docker buildx imagetools create \ | |
--tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:edge \ | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:edge-x86-64 \ | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:edge-i386 \ | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:edge-aarch64 \ | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:edge-armv7 \ | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:edge-armhf \ | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:edge-ppc64le \ | |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:edge-s390x | |
# docker buildx imagetools create \ | |
# --tag ${{ env.DOCKERHUB_REPO }}:edge \ | |
# ${{ env.DOCKERHUB_REPO }}:edge-x86-64 \ | |
# ${{ env.DOCKERHUB_REPO }}:edge-i386 \ | |
# ${{ env.DOCKERHUB_REPO }}:edge-aarch64 \ | |
# ${{ env.DOCKERHUB_REPO }}:edge-armv7 \ | |
# ${{ env.DOCKERHUB_REPO }}:edge-armhf \ | |
# ${{ env.DOCKERHUB_REPO }}:edge-ppc64le \ | |
# ${{ env.DOCKERHUB_REPO }}:edge-s390x |