Skip to content

Commit fce52b8

Browse files
authored
Create build_alpine_base_mimalloc.yaml
1 parent 4992f65 commit fce52b8

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: 🐬 Build Alpine Mimalloc Images for DockerHub 🐬
2+
#REF: https://docs.docker.com/build/ci/github-actions/multi-platform/
3+
#SECRETS: DOCKERHUB_USERNAME || DOCKERHUB_TOKEN
4+
#URL: https://hub.docker.com/r/pkgforge/alpine-base-mimalloc/tags
5+
#For: https://github.com/pkgforge/devscripts/tree/main/Github/Runners
6+
#------------------------------------------------------------------------------------#
7+
on:
8+
#push:
9+
workflow_dispatch:
10+
schedule:
11+
- cron: "30 08 * * 4" # 08:30 PM UTC Fri (02:15 AM NPT Fri Midnight)
12+
# - cron: "*/30 * * * *" # Every 30 Mins
13+
defaults:
14+
run:
15+
shell: bash
16+
working-directory: /tmp
17+
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
#------------------------------------------------------------------------------------#
23+
jobs:
24+
build-push-docker-alpine:
25+
name: Push (alpine-base-mimalloc) --> Docker Hub
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Debloat Runner
30+
run: |
31+
#Presets
32+
set +x ; set +e
33+
#--------------#
34+
#bash <(curl -qfsSL "https://raw.githubusercontent.com/pkgforge/devscripts/refs/heads/main/Github/Runners/debloat_ubuntu.sh")
35+
continue-on-error: true
36+
37+
- name: Setup Env
38+
run: |
39+
#Presets
40+
set +x ; set +e
41+
#--------------#
42+
#Docker Tags
43+
DOCKER_TAG="v$(date +'%Y.%m.%d')" && export DOCKER_TAG="$DOCKER_TAG"
44+
echo "DOCKER_TAG=$DOCKER_TAG" >> "${GITHUB_ENV}"
45+
#GHCR Tags
46+
echo "GHCR_NAME=ghcr.io/${{ github.repository_owner }}/alpine-base-mimalloc" >> "${GITHUB_ENV}"
47+
#Repo
48+
mkdir -p "/tmp" && pushd "/tmp" >/dev/null 2>&1
49+
git clone --filter="blob:none" --depth="1" "https://github.com/pkgforge-dev/alpine-base-mimalloc"
50+
sed '/^FROM/c\FROM alpine:edge' -i "./Dockerfile"
51+
popd >/dev/null 2>&1
52+
continue-on-error: true
53+
54+
- name: Set up QEMU
55+
uses: docker/setup-qemu-action@v3
56+
continue-on-error: true
57+
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@v3
60+
continue-on-error: true
61+
62+
- name: Login to Docker Hub
63+
uses: docker/login-action@v3
64+
with:
65+
username: "${{ secrets.DOCKERHUB_USERNAME }}"
66+
password: "${{ secrets.DOCKERHUB_TOKEN }}"
67+
continue-on-error: true
68+
69+
- name: Login to GHCR
70+
uses: docker/login-action@v3
71+
with:
72+
registry: ghcr.io
73+
username: "${{ github.actor }}"
74+
password: "${{ secrets.GITHUB_TOKEN }}"
75+
76+
#https://hub.docker.com/r/pkgforge/alpine-base-mimalloc
77+
- name: Docker Build and Push (alpine-base-mimalloc)
78+
uses: docker/build-push-action@v6
79+
with:
80+
context: "/tmp/alpine-base-mimalloc"
81+
platforms: "linux/amd64,linux/arm64"
82+
tags: |
83+
pkgforge/alpine-base-mimalloc:latest
84+
pkgforge/alpine-base-mimalloc:${{ env.DOCKER_TAG }}
85+
${{ env.GHCR_NAME }}:latest
86+
${{ env.GHCR_NAME }}:${{ env.DOCKER_TAG }}
87+
push: true
88+
continue-on-error: true

0 commit comments

Comments
 (0)