-
Notifications
You must be signed in to change notification settings - Fork 16
42 lines (42 loc) · 1.41 KB
/
build_minimal.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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