Introduce Alpine 3.20 Variants #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Manual Workflow tiredofit/docker-nginx | ||
name: manual | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
Manual Build: | ||
description: 'Manual Build' | ||
required: false | ||
jobs: | ||
alpine_edge: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "edge" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${DISTRO}-DISTRO_VARIANT}" = "${{ secrets.LATEST }}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
alpine_3-20: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.20" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
echo "*** LATEST_ALPINE ${{ vars.LATEST_ALPINE }}" | ||
echo "**** VAR ${{ vars.LATEST_ALPINE }}" | ||
env | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
alpine_3-19: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.19" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
echo "*** LATEST_ALPINE ${{ vars.LATEST_ALPINE }}" | ||
echo "**** VAR ${{ vars.LATEST_ALPINE }}" | ||
env | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
alpine_3-18: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.18" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
set -x | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
set +x | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-16: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.16" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-15: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.15" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-14: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.14" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-13: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.13" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-12: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.12" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-11: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.11" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-10: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.10" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-9: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.9" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-8: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.8" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-7: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.7" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-6: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.6" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
alpine_3-5: | ||
env: | ||
DISTRO: "alpine" | ||
DISTRO_VARIANT: "3.5" | ||
build_file: Dockerfile | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_ALPINE }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
debian_bookworm: | ||
env: | ||
DISTRO: "debian" | ||
DISTRO_VARIANT: "bookworm" | ||
build_file: Dockerfile.debian | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_DEBIAN }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
### | ||
debian_bullseye: | ||
env: | ||
DISTRO: "debian" | ||
DISTRO_VARIANT: "bullseye" | ||
build_file: Dockerfile.debian | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_DEBIAN }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||
debian_buster: | ||
env: | ||
DISTRO: "debian" | ||
DISTRO_VARIANT: "buster" | ||
build_file: Dockerfile.debian | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
if [[ "${GITHUB_REF}" == refs/heads/* ]]; then | ||
if [[ "${GITHUB_REF}" == refs/heads/*/* ]] ; then | ||
git_branch="${GITHUB_REPOSITORY/docker-/}:$(echo $GITHUB_REF | sed "s|refs/heads/||g" | sed "s|/|-|g")" | ||
else | ||
git_branch=${GITHUB_REF#refs/heads/} | ||
fi | ||
case "${git_branch}" in | ||
"main" | "master" ) | ||
if [ "${{ vars.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ] || [ "${{ secrets.LATEST }}" = "${DISTRO}-${DISTRO_VARIANT}" ]; then | ||
image_latest=",${GITHUB_REPOSITORY}:latest" | ||
fi | ||
if [ "${DISTRO_VARIANT}" = "${{vars.LATEST_DEBIAN }}" ]; then | ||
image_latest+=",${GITHUB_REPOSITORY}:${DISTRO}" | ||
fi | ||
branch_tag="${GITHUB_REPOSITORY}:${DISTRO}-${DISTRO_VARIANT}${image_latest}" | ||
;; | ||
"develop" ) | ||
branch_tag="${GITHUB_REPOSITORY}:develop" | ||
;; | ||
esac | ||
fi | ||
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
git_tag="${GITHUB_REPOSITORY}:${DISTRO_VARIANT}-$(echo ${GITHUB_REF} | sed 's|refs/tags/||g')" | ||
fi | ||
if [ -n "${branch_tag}" ] && [ -n "${git_tag}" ]; then | ||
image_tags=${branch_tag},${git_tag} | ||
else | ||
image_tags="${branch_tag}${git_tag}" | ||
fi | ||
echo "dockerhub_repo=${GITHUB_REPOSITORY/docker-/}" >> $GITHUB_ENV | ||
dockerhub_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|docker.io/${GITHUB_REPOSITORY/docker-/}|g") | ||
ghcr_images=$(echo "${image_tags}" | sed "s|${GITHUB_REPOSITORY}|ghcr.io/${GITHUB_REPOSITORY}|g") | ||
echo "container_images=${dockerhub_images},${ghcr_images}" >> $GITHUB_OUTPUT | ||
- name: Label | ||
id: Label | ||
run: | | ||
image_name=${GITHUB_REPOSITORY/docker-/} | ||
if [ -f "${{ env.build_file }}" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_repository=\"https://github.com/${GITHUB_REPOSITORY}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_commit=\"${GITHUB_SHA}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_committed_by=\"${GITHUB_ACTOR}\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.image_build_date=\"$(date +'%Y-%m-%d %H:%M:%S')\"" ${{ env.build_file }} | ||
sed -i "/FROM .*/a LABEL org.opencontainers.image.source https://github.com/${GITHUB_REPOSITORY}" ${{ env.build_file }} | ||
if [ -f "CHANGELOG.md" ] ; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_changelog_version=\"$(head -n1 ./CHANGELOG.md | awk '{print $2}')\"" ${{ env.build_file }} | ||
mkdir -p install/assets/.changelogs ; cp CHANGELOG.md install/assets/.changelogs/${GITHUB_REPOSITORY/\//_}.md | ||
fi | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_tag=\"${GITHUB_REF#refs/tags/v}\"" ${{ env.build_file }} | ||
fi | ||
if [[ $GITHUB_REF == refs/heads/* ]]; then | ||
sed -i "/FROM .*/a LABEL tiredofit.${image_name}.git_branch=\"${GITHUB_REF#refs/heads/}\"" ${{ env.build_file }} | ||
fi | ||
fi | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: arm,arm64 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build | ||
if: github.event_name != 'pull_request' | ||
uses: docker/build-push-action@v4 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./${{ env.build_file }} | ||
platforms: linux/amd64,linux/arm64,linux/arm/v7 | ||
push: true | ||
tags: ${{ steps.prep.outputs.container_images }} | ||
build-args: | | ||
DISTRO=${{ env.DISTRO }} | ||
DISTRO_VARIANT=${{ env.DISTRO_VARIANT }} | ||
# - name: Update Docker Hub Information | ||
# if: github.event_name != 'pull_request' | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# repository: ${{ env.dockerhub_repo }} | ||
# short-description: ${{ github.event.repository.description }} | ||
# readme-filepath: ./README.md | ||