Skip to content

Merge pull request #96 from theohbrothers/refactor/ci-use-new-version… #377

Merge pull request #96 from theohbrothers/refactor/ci-use-new-version…

Merge pull request #96 from theohbrothers/refactor/ci-use-new-version… #377

Workflow file for this run

name: ci-master-pr
on:
push:
branches:
- master
tags:
- '**'
pull_request:
branches:
- master
merge_group:
jobs:
test-nogitdiff:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/powershell:7.2.2-alpine-3.14-20220318
steps:
- run: |
apk add --no-cache git
- uses: actions/checkout@v3
- name: Ignore git permissions
run: |
git config --global --add safe.directory "$( pwd )"
- name: Generate variants
run: |
pwsh -Command '
$ErrorActionPreference = "Stop"
Install-Module -Name Generate-DockerImageVariants -Force -Scope CurrentUser -Verbose
Generate-DockerImageVariants .
'
- name: Test - no git diff
run: |
git diff --exit-code
build-v4-16-1-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.16.1-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
${{ github.repository }}:latest
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-16-1-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-16-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.16.1-alpine-3.15
VARIANT: v4.16.1-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-16-1-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-16-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.16.1-alpine-3.15
VARIANT: v4.16.1-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.16.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-15-0-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.15.0-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-15-0-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-15-0-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.15.0-alpine-3.15
VARIANT: v4.15.0-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-15-0-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-15-0-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.15.0-alpine-3.15
VARIANT: v4.15.0-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.15.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-14-1-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.14.1-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-14-1-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-14-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.14.1-alpine-3.15
VARIANT: v4.14.1-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-14-1-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-14-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.14.1-alpine-3.15
VARIANT: v4.14.1-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.14.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-13-0-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.13.0-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-13-0-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-13-0-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.13.0-alpine-3.15
VARIANT: v4.13.0-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-13-0-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-13-0-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.13.0-alpine-3.15
VARIANT: v4.13.0-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.13.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-12-0-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.12.0-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-12-0-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-12-0-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.12.0-alpine-3.15
VARIANT: v4.12.0-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-12-0-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-12-0-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.12.0-alpine-3.15
VARIANT: v4.12.0-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.12.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-11-0-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.11.0-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-11-0-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-11-0-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.11.0-alpine-3.15
VARIANT: v4.11.0-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-11-0-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-11-0-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.11.0-alpine-3.15
VARIANT: v4.11.0-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.11.0-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-10-1-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.10.1-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-10-1-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-10-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.10.1-alpine-3.15
VARIANT: v4.10.1-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-10-1-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-10-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.10.1-alpine-3.15
VARIANT: v4.10.1-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.10.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-9-1-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.9.1-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-9-1-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-9-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.9.1-alpine-3.15
VARIANT: v4.9.1-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-9-1-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-9-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.9.1-alpine-3.15
VARIANT: v4.9.1-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.9.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-8-3-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.8.3-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-8-3-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-8-3-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.8.3-alpine-3.15
VARIANT: v4.8.3-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-8-3-docker-go-1-20-8-alpine-3-15:
needs: [test-nogitdiff, build-v4-8-3-docker-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.8.3-docker-alpine-3.15
VARIANT: v4.8.3-docker-go-1.20.8-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-go-1.20.8-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-go-1.20.8-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-go-1.20.8-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-8-3-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-8-3-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.8.3-alpine-3.15
VARIANT: v4.8.3-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-8-3-docker-rootless-go-1-20-8-alpine-3-15:
needs: [test-nogitdiff, build-v4-8-3-docker-rootless-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.8.3-docker-rootless-alpine-3.15
VARIANT: v4.8.3-docker-rootless-go-1.20.8-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-rootless-go-1.20.8-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-rootless-go-1.20.8-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.8.3-docker-rootless-go-1.20.8-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-7-1-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.7.1-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-7-1-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-7-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.7.1-alpine-3.15
VARIANT: v4.7.1-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-7-1-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-7-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.7.1-alpine-3.15
VARIANT: v4.7.1-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.7.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-6-1-alpine-3-15:
needs: [test-nogitdiff]
runs-on: ubuntu-latest
env:
BASEVARIANT: ''
VARIANT: v4.6.1-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
cache-to: |
type=inline
build-v4-6-1-docker-alpine-3-15:
needs: [test-nogitdiff, build-v4-6-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.6.1-alpine-3.15
VARIANT: v4.6.1-docker-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-docker-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
build-v4-6-1-docker-rootless-alpine-3-15:
needs: [test-nogitdiff, build-v4-6-1-alpine-3-15]
runs-on: ubuntu-latest
env:
BASEVARIANT: v4.6.1-alpine-3.15
VARIANT: v4.6.1-docker-rootless-alpine-3.15
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Display system info (linux)
run: |
set -e
hostname
whoami
cat /etc/*release
lscpu
free
df -h
pwd
docker info
docker version
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
# This step generates the docker tags
- name: Prepare
id: prep
run: |
set -e
# Get ref, i.e. <branch_name> from refs/heads/<branch_name>, or <tag-name> from refs/tags/<tag_name>. E.g. 'master' or 'v0.0.0'
REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev )
# Get short commit hash E.g. 'abc0123'
SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 )
# Generate docker image tags
# E.g. 'v0.0.0-<variant>' and 'v0.0.0-abc0123-<variant>'
# E.g. 'master-<variant>' and 'master-abc0123-<variant>'
REF_SHA_BASEVARIANT="${REF}-${SHA}-${BASEVARIANT}"
REF_VARIANT="${REF}-${VARIANT}"
REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}"
# Pass variables to next step
echo "REF_SHA_BASEVARIANT=$REF_SHA_BASEVARIANT" >> $GITHUB_ENV
echo "VARIANT=$VARIANT" >> $GITHUB_ENV
echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_ENV
echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_ENV
- name: Login to Docker Hub registry
# if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
- name: Build (PRs)
# Run only on pull requests
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (master)
# Run only on master
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
- name: Build and push (release)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
context: variants/v4.6.1-docker-rootless-alpine-3.15
platforms: linux/amd64
push: true
tags: |
${{ github.repository }}:${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_VARIANT }}
secrets: |
"GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}"
cache-from: |
${{ github.repository }}:master-${{ env.VARIANT }}
${{ github.repository }}:${{ env.REF_SHA_BASEVARIANT }}
cache-to: |
type=inline
update-draft-release:
needs: [build-v4-16-1-alpine-3-15, build-v4-16-1-docker-alpine-3-15, build-v4-16-1-docker-rootless-alpine-3-15, build-v4-15-0-alpine-3-15, build-v4-15-0-docker-alpine-3-15, build-v4-15-0-docker-rootless-alpine-3-15, build-v4-14-1-alpine-3-15, build-v4-14-1-docker-alpine-3-15, build-v4-14-1-docker-rootless-alpine-3-15, build-v4-13-0-alpine-3-15, build-v4-13-0-docker-alpine-3-15, build-v4-13-0-docker-rootless-alpine-3-15, build-v4-12-0-alpine-3-15, build-v4-12-0-docker-alpine-3-15, build-v4-12-0-docker-rootless-alpine-3-15, build-v4-11-0-alpine-3-15, build-v4-11-0-docker-alpine-3-15, build-v4-11-0-docker-rootless-alpine-3-15, build-v4-10-1-alpine-3-15, build-v4-10-1-docker-alpine-3-15, build-v4-10-1-docker-rootless-alpine-3-15, build-v4-9-1-alpine-3-15, build-v4-9-1-docker-alpine-3-15, build-v4-9-1-docker-rootless-alpine-3-15, build-v4-8-3-alpine-3-15, build-v4-8-3-docker-alpine-3-15, build-v4-8-3-docker-go-1-20-8-alpine-3-15, build-v4-8-3-docker-rootless-alpine-3-15, build-v4-8-3-docker-rootless-go-1-20-8-alpine-3-15, build-v4-7-1-alpine-3-15, build-v4-7-1-docker-alpine-3-15, build-v4-7-1-docker-rootless-alpine-3-15, build-v4-6-1-alpine-3-15, build-v4-6-1-docker-alpine-3-15, build-v4-6-1-docker-rootless-alpine-3-15]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
publish: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-draft-release:
needs: [build-v4-16-1-alpine-3-15, build-v4-16-1-docker-alpine-3-15, build-v4-16-1-docker-rootless-alpine-3-15, build-v4-15-0-alpine-3-15, build-v4-15-0-docker-alpine-3-15, build-v4-15-0-docker-rootless-alpine-3-15, build-v4-14-1-alpine-3-15, build-v4-14-1-docker-alpine-3-15, build-v4-14-1-docker-rootless-alpine-3-15, build-v4-13-0-alpine-3-15, build-v4-13-0-docker-alpine-3-15, build-v4-13-0-docker-rootless-alpine-3-15, build-v4-12-0-alpine-3-15, build-v4-12-0-docker-alpine-3-15, build-v4-12-0-docker-rootless-alpine-3-15, build-v4-11-0-alpine-3-15, build-v4-11-0-docker-alpine-3-15, build-v4-11-0-docker-rootless-alpine-3-15, build-v4-10-1-alpine-3-15, build-v4-10-1-docker-alpine-3-15, build-v4-10-1-docker-rootless-alpine-3-15, build-v4-9-1-alpine-3-15, build-v4-9-1-docker-alpine-3-15, build-v4-9-1-docker-rootless-alpine-3-15, build-v4-8-3-alpine-3-15, build-v4-8-3-docker-alpine-3-15, build-v4-8-3-docker-go-1-20-8-alpine-3-15, build-v4-8-3-docker-rootless-alpine-3-15, build-v4-8-3-docker-rootless-go-1-20-8-alpine-3-15, build-v4-7-1-alpine-3-15, build-v4-7-1-docker-alpine-3-15, build-v4-7-1-docker-rootless-alpine-3-15, build-v4-6-1-alpine-3-15, build-v4-6-1-docker-alpine-3-15, build-v4-6-1-docker-rootless-alpine-3-15]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
publish: true
name: ${{ github.ref_name }} # E.g. 'master' or 'v1.2.3'
tag: ${{ github.ref_name }} # E.g. 'master' or 'v1.2.3'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-dockerhub-description:
needs: [build-v4-16-1-alpine-3-15, build-v4-16-1-docker-alpine-3-15, build-v4-16-1-docker-rootless-alpine-3-15, build-v4-15-0-alpine-3-15, build-v4-15-0-docker-alpine-3-15, build-v4-15-0-docker-rootless-alpine-3-15, build-v4-14-1-alpine-3-15, build-v4-14-1-docker-alpine-3-15, build-v4-14-1-docker-rootless-alpine-3-15, build-v4-13-0-alpine-3-15, build-v4-13-0-docker-alpine-3-15, build-v4-13-0-docker-rootless-alpine-3-15, build-v4-12-0-alpine-3-15, build-v4-12-0-docker-alpine-3-15, build-v4-12-0-docker-rootless-alpine-3-15, build-v4-11-0-alpine-3-15, build-v4-11-0-docker-alpine-3-15, build-v4-11-0-docker-rootless-alpine-3-15, build-v4-10-1-alpine-3-15, build-v4-10-1-docker-alpine-3-15, build-v4-10-1-docker-rootless-alpine-3-15, build-v4-9-1-alpine-3-15, build-v4-9-1-docker-alpine-3-15, build-v4-9-1-docker-rootless-alpine-3-15, build-v4-8-3-alpine-3-15, build-v4-8-3-docker-alpine-3-15, build-v4-8-3-docker-go-1-20-8-alpine-3-15, build-v4-8-3-docker-rootless-alpine-3-15, build-v4-8-3-docker-rootless-go-1-20-8-alpine-3-15, build-v4-7-1-alpine-3-15, build-v4-7-1-docker-alpine-3-15, build-v4-7-1-docker-rootless-alpine-3-15, build-v4-6-1-alpine-3-15, build-v4-6-1-docker-alpine-3-15, build-v4-6-1-docker-rootless-alpine-3-15]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_REGISTRY_USER }}
password: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }}
repository: ${{ github.repository }}
short-description: ${{ github.event.repository.description }}