ksandermann is BUILDING Minimal Image 🚀 #90
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
name: Build Minimal Image | |
run-name: ${{ github.actor }} is BUILDING Minimal Image 🚀 | |
#on: [workflow_dispatch] | |
on: | |
schedule: | |
#UTC - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
- cron: '19 3 * * MON' | |
- cron: '19 3 * * FRI' | |
jobs: | |
Clean-Repo: | |
runs-on: [self-hosted, Linux, X64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get current date | |
run: echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV} | |
- name: Fetch origin | |
run: git fetch origin | |
- name: Checkout master | |
run: git checkout master | |
- name: Delete local branches | |
run: git checkout -b "tmp" || true && git checkout master && git for-each-ref --format '%(refname:short)' refs/heads | grep -v "master\|main" | xargs git branch -D | |
- name: Pull origin | |
run: git pull origin master | |
Build-Images: | |
timeout-minutes: 90 | |
needs: Clean-Repo | |
runs-on: [self-hosted, Linux, X64] | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up QEMU | |
id: qemu | |
uses: docker/[email protected] | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: all | |
- name: Build Images | |
run: bash ./build_minimal.sh |