🐬 Builds GH-Runner Images (Self-Hosted) DockerHub 🐬 #88
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: 🐬 Builds GH-Runner Images (Self-Hosted) DockerHub 🐬 | |
| #REF: https://docs.docker.com/build/ci/github-actions/multi-platform/ | |
| #SECRETS: DOCKERHUB_USERNAME || DOCKERHUB_TOKEN | |
| #URL: https://hub.docker.com/u/pkgforge | |
| #------------------------------------------------------------------------------------# | |
| on: | |
| #push: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "30 08 * * 4" # 08:30 PM UTC Thu (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-runner-aarch64: | |
| name: Push (runner-aarch64) --> Docker Hub | |
| #runs-on: ubuntu-latest | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: main | |
| filter: "blob:none" | |
| - 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}" | |
| #Copy dockerfiles | |
| mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES" | |
| cp "${GITHUB_WORKSPACE}/main/Github/Runners/aarch64-ubuntu.dockerfile" "/tmp/DOCKERFILES/aarch64-ubuntu.dockerfile" | |
| cp "${GITHUB_WORKSPACE}/main/Github/Runners/manage_linux.sh" "/tmp/DOCKERFILES/manager.sh" | |
| 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 }}" | |
| continue-on-error: true | |
| #https://hub.docker.com/r/pkgforge/gh-runner-aarch64-ubuntu | |
| - name: Docker Build and Push (gh-runner-aarch64-ubuntu) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: /tmp/DOCKERFILES/ | |
| file: "/tmp/DOCKERFILES/aarch64-ubuntu.dockerfile" | |
| #platforms: "linux/amd64,linux/arm64" | |
| platforms: "linux/arm64" | |
| tags: | | |
| pkgforge/gh-runner-aarch64-ubuntu:latest | |
| pkgforge/gh-runner-aarch64-ubuntu:latest-${{ env.DOCKER_TAG }} | |
| ghcr.io/pkgforge/devscripts/gh-runner-aarch64-ubuntu:latest | |
| ghcr.io/pkgforge/devscripts/gh-runner-aarch64-ubuntu:latest-${{ env.DOCKER_TAG }} | |
| outputs: type=registry,compression=zstd,compression-level=22 | |
| continue-on-error: true | |
| #------------------------------------------------------------------------------------# | |
| build-push-docker-runner-riscv64: | |
| name: Push (runner-riscv64) --> Docker Hub | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: main | |
| filter: "blob:none" | |
| - 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}" | |
| #Copy dockerfiles | |
| mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES" | |
| cp "${GITHUB_WORKSPACE}/main/Github/Runners/riscv64-ubuntu.dockerfile" "/tmp/DOCKERFILES/riscv64-ubuntu.dockerfile" | |
| cp "${GITHUB_WORKSPACE}/main/Github/Runners/manage_linux.sh" "/tmp/DOCKERFILES/manager.sh" | |
| 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 }}" | |
| continue-on-error: true | |
| #https://hub.docker.com/r/pkgforge/gh-runner-riscv64-ubuntu | |
| - name: Docker Build and Push (gh-runner-riscv64-ubuntu) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: /tmp/DOCKERFILES/ | |
| file: "/tmp/DOCKERFILES/riscv64-ubuntu.dockerfile" | |
| platforms: "linux/riscv64" | |
| tags: | | |
| pkgforge/gh-runner-riscv64-ubuntu:latest | |
| pkgforge/gh-runner-riscv64-ubuntu:${{ env.DOCKER_TAG }} | |
| ghcr.io/pkgforge/devscripts/gh-runner-riscv64-ubuntu:latest | |
| ghcr.io/pkgforge/devscripts/gh-runner-riscv64-ubuntu:${{ env.DOCKER_TAG }} | |
| outputs: type=registry,compression=zstd,compression-level=22 | |
| continue-on-error: true | |
| #------------------------------------------------------------------------------------# | |
| build-push-docker-runner-x86-64: | |
| name: Push (runner-x86_64) --> Docker Hub | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: main | |
| filter: "blob:none" | |
| - 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}" | |
| #Copy dockerfiles | |
| mkdir -p "/tmp/DOCKERFILES" && cd "/tmp/DOCKERFILES" | |
| cp "${GITHUB_WORKSPACE}/main/Github/Runners/x86_64-ubuntu.dockerfile" "/tmp/DOCKERFILES/x86_64-ubuntu.dockerfile" | |
| cp "${GITHUB_WORKSPACE}/main/Github/Runners/manage_linux.sh" "/tmp/DOCKERFILES/manager.sh" | |
| 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 }}" | |
| continue-on-error: true | |
| #https://hub.docker.com/r/pkgforge/gh-runner-x86_64-ubuntu | |
| - name: Docker Build and Push (gh-runner-x86_64-ubuntu) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: /tmp/DOCKERFILES/ | |
| file: "/tmp/DOCKERFILES/x86_64-ubuntu.dockerfile" | |
| #platforms: "linux/amd64,linux/arm64" | |
| platforms: "linux/amd64" | |
| tags: | | |
| pkgforge/gh-runner-x86_64-ubuntu:latest | |
| pkgforge/gh-runner-x86_64-ubuntu:${{ env.DOCKER_TAG }} | |
| ghcr.io/pkgforge/devscripts/gh-runner-x86_64-ubuntu:latest | |
| ghcr.io/pkgforge/devscripts/gh-runner-x86_64-ubuntu:${{ env.DOCKER_TAG }} | |
| outputs: type=registry,compression=zstd,compression-level=22 | |
| continue-on-error: true | |
| #------------------------------------------------------------------------------------# |