🐬 Build Alpine Mimalloc Images for DockerHub 🐬 #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🐬 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/refs/heads/main/Github/Runners/debloat_ubuntu.sh") | |
| 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" | |
| sed '/^FROM/c\FROM alpine:edge' -i "./Dockerfile" | |
| 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 }}" | |
| #https://hub.docker.com/r/pkgforge/alpine-base-mimalloc | |
| - name: Docker Build and Push (alpine-base-mimalloc) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: "/tmp/alpine-base-mimalloc" | |
| platforms: "linux/amd64,linux/arm64" | |
| tags: | | |
| pkgforge/alpine-base-mimalloc:latest | |
| pkgforge/alpine-base-mimalloc:${{ env.DOCKER_TAG }} | |
| ${{ env.GHCR_NAME }}:latest | |
| ${{ env.GHCR_NAME }}:${{ env.DOCKER_TAG }} | |
| push: true | |
| continue-on-error: true |