forked from tete1030/openwrt-fastbuild-actions
-
Notifications
You must be signed in to change notification settings - Fork 10
125 lines (110 loc) · 3.56 KB
/
squash.yml
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#=================================================
# https://github.com/tete1030/openwrt-fastbuild-actions
# Description: FAST building OpenWrt with Github Actions and Docker!
# Lisence: MIT
# Author: Texot
#=================================================
env:
# DO NOT CHANGE the following here, set them only in forked repo's Settings->Secrets page
# You don't need to set docker_registry if you are using the default Docker Hub
# 安全起见以下参数请不要在此更改,在你Fork的repo中,Settings->Secrets页面更改
# 如果你想使用默认的Docker Hub,你不需要在secrets页面设置docker_registry
DK_REGISTRY: ${{secrets.docker_registry}}
DK_USERNAME: ${{secrets.docker_username}}
DK_PASSWORD: ${{secrets.docker_password}}
SLACK_WEBHOOK_URL: ${{secrets.SLACK_WEBHOOK_URL}}
TMATE_ENCRYPT_PASSWORD: ${{secrets.TMATE_ENCRYPT_PASSWORD}}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Squash builders
# Start every 24 hours
on:
workflow_dispatch:
deployment:
schedule:
- cron: '10 6/24 */7 * *'
jobs:
squash:
name: ${{matrix.title}} ${{matrix.target}}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
mode:
- normal
- test
target:
#- 19.07.7
#- 19.07.8
#- 19.07.10
#- 21.02.0
#- 21.02.1
#- 21.02.2
#- 21.02.3
#- 21.02.5
#- 21.02.6
#- 21.02.7
#- 22.03.0
#- 22.03.2
#- 22.03.3
#- 22.03.4
#- 22.03.5
#- 22.03.6
#- 23.05.2
#- 23.05.3
#- 23.05.4
- 23.05.5
- snapshot
include:
- mode: normal
title: Squashing builder
- mode: test
title: Squashing test builder
env:
HOST_WORK_DIR: ${{github.workspace}}
BUILD_MODE: ${{matrix.mode}}
BUILD_TARGET: ${{matrix.target}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Init build env
run: scripts/cisteps/squash/01-init_env.sh
- name: Check if skip this job
run: scripts/cisteps/squash/02-check_target.sh
- name: Clean up for extra space
if: env.SKIP_TARGET == '0'
run: scripts/cisteps/squash/03-clean_up.sh
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
id: buildx-qemy
if: env.SKIP_TARGET == '0'
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
if: env.SKIP_TARGET == '0'
uses: docker/setup-buildx-action@v3
- name: Configure docker
if: env.SKIP_TARGET == '0'
run: scripts/cisteps/squash/04-configure_docker.sh
- name: Check status of builder
if: env.SKIP_TARGET == '0'
run: scripts/cisteps/squash/05-check_builders.sh
- name: Download lastest builder
if: env.SKIP_TARGET == '0'
run: scripts/cisteps/squash/06-get_builder.sh
- name: Print disk space & size images
if: env.SKIP_TARGET == '0'
run: |
df -h
docker image ls
- name: Squash builder when necessary
if: env.SKIP_TARGET == '0'
run: scripts/cisteps/squash/07-squash_builder.sh
- name: Print disk space & size images
if: env.SKIP_TARGET == '0'
run: |
df -h
docker image ls
- name: Upload squashed builder
if: env.SKIP_TARGET == '0'
run: scripts/cisteps/squash/08-upload_builder.sh