Skip to content

Commit 2655813

Browse files
authored
Merge pull request #233 from devilbox/nightly-jobs
Separate nightly jobs
2 parents 52c1a90 + 0011b2e commit 2655813

5 files changed

Lines changed: 333 additions & 1 deletion

File tree

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
---
2+
3+
# -------------------------------------------------------------------------------------------------
4+
# Job Name
5+
# -------------------------------------------------------------------------------------------------
6+
name: nightly
7+
8+
9+
# -------------------------------------------------------------------------------------------------
10+
# When to run
11+
# -------------------------------------------------------------------------------------------------
12+
on:
13+
# Runs daily
14+
schedule:
15+
- cron: '0 0 * * *'
16+
17+
18+
jobs:
19+
20+
# -----------------------------------------------------------------------------------------------
21+
# (1/8) Determine parameter settings
22+
# -----------------------------------------------------------------------------------------------
23+
params:
24+
uses: ./.github/workflows/params-nightly_master.yml
25+
26+
27+
# -----------------------------------------------------------------------------------------------
28+
# (2/8) Configure Build and Deploy Matrices
29+
# -----------------------------------------------------------------------------------------------
30+
configure:
31+
needs: [params]
32+
uses: ./.github/workflows/zzz-reuse-configure.yml
33+
with:
34+
enabled: true
35+
can_deploy: true
36+
matrix: ${{ needs.params.outputs.matrix }}
37+
refs: ${{ needs.params.outputs.refs }}
38+
secrets:
39+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
40+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
41+
42+
43+
# -----------------------------------------------------------------------------------------------
44+
# (3/8) Build & Test base
45+
# -----------------------------------------------------------------------------------------------
46+
base:
47+
needs:
48+
- params
49+
- configure
50+
uses: ./.github/workflows/zzz-reuse-build.yml
51+
with:
52+
enabled: true
53+
can_deploy: true
54+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
55+
has_refs: ${{ needs.configure.outputs.has_refs }}
56+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
57+
flavour: base
58+
secrets:
59+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
60+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
61+
62+
63+
# -----------------------------------------------------------------------------------------------
64+
# (4/8) Build & Test mods
65+
# -----------------------------------------------------------------------------------------------
66+
mods:
67+
needs:
68+
- params
69+
- configure
70+
- base
71+
uses: ./.github/workflows/zzz-reuse-build.yml
72+
with:
73+
enabled: true
74+
can_deploy: true
75+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
76+
has_refs: ${{ needs.configure.outputs.has_refs }}
77+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
78+
flavour: mods
79+
secrets:
80+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
81+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
82+
83+
84+
# -----------------------------------------------------------------------------------------------
85+
# (5/8) Build & Test prod
86+
# -----------------------------------------------------------------------------------------------
87+
prod:
88+
needs:
89+
- params
90+
- configure
91+
- base
92+
- mods
93+
uses: ./.github/workflows/zzz-reuse-build.yml
94+
with:
95+
enabled: true
96+
can_deploy: true
97+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
98+
has_refs: ${{ needs.configure.outputs.has_refs }}
99+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
100+
flavour: prod
101+
secrets:
102+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
103+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
104+
105+
106+
# -----------------------------------------------------------------------------------------------
107+
# (6/8) Build & Test work
108+
# -----------------------------------------------------------------------------------------------
109+
work:
110+
needs:
111+
- params
112+
- configure
113+
- base
114+
- mods
115+
- prod
116+
uses: ./.github/workflows/zzz-reuse-build.yml
117+
with:
118+
enabled: true
119+
can_deploy: true
120+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
121+
has_refs: ${{ needs.configure.outputs.has_refs }}
122+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
123+
flavour: work
124+
secrets:
125+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
126+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
127+
128+
129+
# -----------------------------------------------------------------------------------------------
130+
# (7/8) Push images
131+
# -----------------------------------------------------------------------------------------------
132+
push-image:
133+
needs:
134+
- params
135+
- configure
136+
- base
137+
- mods
138+
- prod
139+
- work
140+
uses: ./.github/workflows/zzz-reuse-deploy-images.yml
141+
with:
142+
enabled: true
143+
can_deploy: true
144+
build_matrix: ${{ needs.configure.outputs.matrix_build }}
145+
has_refs: ${{ needs.configure.outputs.has_refs }}
146+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
147+
secrets:
148+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
149+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
150+
151+
152+
# -----------------------------------------------------------------------------------------------
153+
# (8/8) Push Manifests
154+
# -----------------------------------------------------------------------------------------------
155+
push-manifest:
156+
needs:
157+
- params
158+
- configure
159+
- base
160+
- mods
161+
- prod
162+
- work
163+
- push-image
164+
uses: ./.github/workflows/zzz-reuse-deploy-manifests.yml
165+
with:
166+
enabled: true
167+
can_deploy: true
168+
deploy_matrix: ${{ needs.configure.outputs.matrix_deploy }}
169+
params_matrix: ${{ needs.params.outputs.matrix }}
170+
has_refs: ${{ needs.configure.outputs.has_refs }}
171+
artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }}
172+
secrets:
173+
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
174+
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}

.github/workflows/action_schedule.yml renamed to .github/workflows/action_schedule_tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# (1/8) Determine parameter settings
2222
# -----------------------------------------------------------------------------------------------
2323
params:
24-
uses: ./.github/workflows/params.yml
24+
uses: ./.github/workflows/params-nightly_tags.yml
2525

2626

2727
# -----------------------------------------------------------------------------------------------
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
3+
# -------------------------------------------------------------------------------------------------
4+
# Job Name
5+
# -------------------------------------------------------------------------------------------------
6+
name: params
7+
8+
9+
# -------------------------------------------------------------------------------------------------
10+
# Custom Variables
11+
# -------------------------------------------------------------------------------------------------
12+
env:
13+
MATRIX: >-
14+
[
15+
{
16+
"NAME": "PHP",
17+
"VERSION": ["5.2"],
18+
"FLAVOUR": ["default"],
19+
"ARCH": ["linux/amd64"]
20+
},
21+
{
22+
"NAME": "PHP",
23+
"VERSION": ["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"],
24+
"FLAVOUR": ["default"],
25+
"ARCH": ["linux/amd64"]
26+
}
27+
]
28+
29+
30+
# -------------------------------------------------------------------------------------------------
31+
# When to run
32+
# -------------------------------------------------------------------------------------------------
33+
on:
34+
workflow_call:
35+
outputs:
36+
matrix:
37+
description: "The determined version matrix"
38+
value: ${{ jobs.params.outputs.matrix }}
39+
refs:
40+
description: "The determined git ref matrix (only during scheduled run)"
41+
value: ${{ jobs.params.outputs.refs }}
42+
43+
jobs:
44+
params:
45+
runs-on: ubuntu-latest
46+
47+
outputs:
48+
matrix: ${{ steps.set-matrix.outputs.matrix }}
49+
refs: ${{ steps.set-refs.outputs.matrix }}
50+
51+
steps:
52+
- name: "[Set-Output] Matrix"
53+
id: set-matrix
54+
run: |
55+
echo "::set-output name=matrix::$( echo '${{ env.MATRIX }}' | jq -M -c )"
56+
57+
- name: "[Set-Output] Matrix 'Refs' (master branch and latest tag)"
58+
id: set-refs
59+
uses: cytopia/[email protected]
60+
with:
61+
repository_default_branch: master
62+
branches: master
63+
num_latest_tags: 0
64+
if: github.event_name == 'schedule'
65+
66+
- name: "[DEBUG] Show settings'"
67+
run: |
68+
echo 'Matrix'
69+
echo '--------------------'
70+
echo '${{ steps.set-matrix.outputs.matrix }}'
71+
echo
72+
73+
echo 'Matrix: Refs'
74+
echo '--------------------'
75+
echo '${{ steps.set-matrix-refs.outputs.matrix }}'
76+
echo
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
3+
# -------------------------------------------------------------------------------------------------
4+
# Job Name
5+
# -------------------------------------------------------------------------------------------------
6+
name: params
7+
8+
9+
# -------------------------------------------------------------------------------------------------
10+
# Custom Variables
11+
# -------------------------------------------------------------------------------------------------
12+
env:
13+
MATRIX: >-
14+
[
15+
{
16+
"NAME": "PHP",
17+
"VERSION": ["5.2"],
18+
"FLAVOUR": ["default"],
19+
"ARCH": ["linux/amd64"]
20+
},
21+
{
22+
"NAME": "PHP",
23+
"VERSION": ["5.3", "5.4", "5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2"],
24+
"FLAVOUR": ["default"],
25+
"ARCH": ["linux/amd64"]
26+
}
27+
]
28+
29+
30+
# -------------------------------------------------------------------------------------------------
31+
# When to run
32+
# -------------------------------------------------------------------------------------------------
33+
on:
34+
workflow_call:
35+
outputs:
36+
matrix:
37+
description: "The determined version matrix"
38+
value: ${{ jobs.params.outputs.matrix }}
39+
refs:
40+
description: "The determined git ref matrix (only during scheduled run)"
41+
value: ${{ jobs.params.outputs.refs }}
42+
43+
jobs:
44+
params:
45+
runs-on: ubuntu-latest
46+
47+
outputs:
48+
matrix: ${{ steps.set-matrix.outputs.matrix }}
49+
refs: ${{ steps.set-refs.outputs.matrix }}
50+
51+
steps:
52+
- name: "[Set-Output] Matrix"
53+
id: set-matrix
54+
run: |
55+
echo "::set-output name=matrix::$( echo '${{ env.MATRIX }}' | jq -M -c )"
56+
57+
- name: "[Set-Output] Matrix 'Refs' (master branch and latest tag)"
58+
id: set-refs
59+
uses: cytopia/[email protected]
60+
with:
61+
repository_default_branch: master
62+
branches: ""
63+
num_latest_tags: 1
64+
if: github.event_name == 'schedule'
65+
66+
- name: "[DEBUG] Show settings'"
67+
run: |
68+
echo 'Matrix'
69+
echo '--------------------'
70+
echo '${{ steps.set-matrix.outputs.matrix }}'
71+
echo
72+
73+
echo 'Matrix: Refs'
74+
echo '--------------------'
75+
echo '${{ steps.set-matrix-refs.outputs.matrix }}'
76+
echo

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
## Unreleased
55

66

7+
## Release 0.138
8+
9+
#### Changed
10+
- Separated nightly jobs
11+
12+
713
## Release 0.137
814

915
#### Fixed

0 commit comments

Comments
 (0)