Skip to content

🐬 Build Alpine Mimalloc Images for DockerHub 🐬 #44

🐬 Build Alpine Mimalloc Images for DockerHub 🐬

🐬 Build Alpine Mimalloc Images for DockerHub 🐬 #44

name: 🐬 Build Alpine Mimalloc Images for DockerHub 🐬
#REF: https://docs.docker.com/build/ci/github-actions/multi-platform/
#SECRETS: DOCKERHUB_USERNAME || DOCKERHUB_TOKEN
#URL: https://hub.docker.com/r/pkgforge/alpine-base-mimalloc/tags
#For: https://github.com/pkgforge/devscripts/tree/main/Github/Runners
#------------------------------------------------------------------------------------#
on:
#push:
workflow_dispatch:
schedule:
- cron: "30 08 * * 4" # 08:30 PM UTC Fri (02:15 AM NPT Fri Midnight)
# - cron: "*/30 * * * *" # Every 30 Mins
defaults:
run:
shell: bash
working-directory: /tmp
permissions:
contents: read
packages: write
#------------------------------------------------------------------------------------#
jobs:
build-push-docker-alpine:
name: Push (alpine-base-mimalloc) --> Docker Hub
runs-on: ubuntu-latest
steps:
- name: Debloat Runner
run: |
#Presets
set +x ; set +e
#--------------#
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/main/Github/Runners/debloat_ubuntu.sh") --force
continue-on-error: true
- name: Setup Env
run: |
#Presets
set +x ; set +e
#--------------#
#Docker Tags
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
echo "DOCKER_TAG=$DOCKER_TAG" >> "${GITHUB_ENV}"
#GHCR Tags
echo "GHCR_NAME=ghcr.io/${{ github.repository_owner }}/alpine-base-mimalloc" >> "${GITHUB_ENV}"
#Repo
mkdir -p "/tmp" && pushd "/tmp" >/dev/null 2>&1
git clone --filter="blob:none" --depth="1" "https://github.com/pkgforge-dev/alpine-base-mimalloc"
popd >/dev/null 2>&1
continue-on-error: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
continue-on-error: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
continue-on-error: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: "${{ secrets.DOCKERHUB_USERNAME }}"
password: "${{ secrets.DOCKERHUB_TOKEN }}"
continue-on-error: true
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Switch to Edge
run: |
#Presets
set +x ; set +e
#--------------#
sed '/^FROM/c\FROM alpine:edge' -i "/tmp/alpine-base-mimalloc/Dockerfile"
continue-on-error: true
#https://hub.docker.com/r/pkgforge/alpine-base-mimalloc [edge]
- name: Docker Build and Push (alpine-base-mimalloc:edge)
uses: docker/build-push-action@v6
with:
context: "/tmp/alpine-base-mimalloc"
platforms: "linux/amd64,linux/arm64,linux/riscv64"
tags: |
pkgforge/alpine-base-mimalloc:edge
pkgforge/alpine-base-mimalloc:${{ env.DOCKER_TAG }}
${{ env.GHCR_NAME }}:edge
${{ env.GHCR_NAME }}:${{ env.DOCKER_TAG }}
push: true
continue-on-error: true
- name: Switch to Stable
run: |
#Presets
set +x ; set +e
#--------------#
sed '/^FROM/c\FROM alpine:latest' -i "/tmp/alpine-base-mimalloc/Dockerfile"
continue-on-error: true
#https://hub.docker.com/r/pkgforge/alpine-base-mimalloc [stable]
- name: Docker Build and Push (alpine-base-mimalloc:stable)
uses: docker/build-push-action@v6
with:
context: "/tmp/alpine-base-mimalloc"
platforms: "linux/amd64,linux/arm64"
tags: |
pkgforge/alpine-base-mimalloc:stable
pkgforge/alpine-base-mimalloc:${{ env.DOCKER_TAG }}
${{ env.GHCR_NAME }}:stable
${{ env.GHCR_NAME }}:${{ env.DOCKER_TAG }}
push: true
continue-on-error: true