|
| 1 | +--- |
| 2 | + |
| 3 | +# ------------------------------------------------------------------------------------------------- |
| 4 | +# Job Name |
| 5 | +# ------------------------------------------------------------------------------------------------- |
| 6 | +name: nightly |
| 7 | + |
| 8 | + |
| 9 | +# ------------------------------------------------------------------------------------------------- |
| 10 | +# When to run |
| 11 | +# ------------------------------------------------------------------------------------------------- |
| 12 | +on: |
| 13 | + schedule: |
| 14 | + - cron: '0 0 * * *' |
| 15 | + workflow_dispatch: |
| 16 | + |
| 17 | + |
| 18 | +jobs: |
| 19 | + |
| 20 | + # ----------------------------------------------------------------------------------------------- |
| 21 | + # (1/8) Determine parameter settings |
| 22 | + # ----------------------------------------------------------------------------------------------- |
| 23 | + params: |
| 24 | + uses: ./.github/workflows/params-nightly_tags.yml |
| 25 | + |
| 26 | + |
| 27 | + # ----------------------------------------------------------------------------------------------- |
| 28 | + # (2/8) Configure Build and Deploy Matrices |
| 29 | + # ----------------------------------------------------------------------------------------------- |
| 30 | + configure: |
| 31 | + needs: [params] |
| 32 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-configure.yml@master |
| 33 | + with: |
| 34 | + enabled: true |
| 35 | + can_deploy: true |
| 36 | + is_scheduled: true |
| 37 | + versions: ${{ needs.params.outputs.versions }} |
| 38 | + refs: ${{ needs.params.outputs.refs }} |
| 39 | + secrets: |
| 40 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 41 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 42 | + |
| 43 | + |
| 44 | + # ----------------------------------------------------------------------------------------------- |
| 45 | + # (3/8) Build & Test base |
| 46 | + # ----------------------------------------------------------------------------------------------- |
| 47 | + base: |
| 48 | + needs: |
| 49 | + - configure |
| 50 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master |
| 51 | + with: |
| 52 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 53 | + run_tests: false |
| 54 | + upload_artifact: true |
| 55 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 56 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 57 | + stage: base |
| 58 | + stage_prev: '' |
| 59 | + |
| 60 | + base-test: |
| 61 | + needs: |
| 62 | + - configure |
| 63 | + - base |
| 64 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master |
| 65 | + with: |
| 66 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 67 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 68 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 69 | + stage: base |
| 70 | + |
| 71 | + |
| 72 | + # ----------------------------------------------------------------------------------------------- |
| 73 | + # (4/8) Build & Test mods |
| 74 | + # ----------------------------------------------------------------------------------------------- |
| 75 | + mods: |
| 76 | + needs: |
| 77 | + - configure |
| 78 | + - base |
| 79 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master |
| 80 | + with: |
| 81 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 82 | + run_tests: false |
| 83 | + upload_artifact: true |
| 84 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 85 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 86 | + stage: mods |
| 87 | + stage_prev: base |
| 88 | + |
| 89 | + mods-test: |
| 90 | + needs: |
| 91 | + - configure |
| 92 | + - mods |
| 93 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master |
| 94 | + with: |
| 95 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 96 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 97 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 98 | + stage: mods |
| 99 | + |
| 100 | + |
| 101 | + # ----------------------------------------------------------------------------------------------- |
| 102 | + # (5/8) Build & Test prod |
| 103 | + # ----------------------------------------------------------------------------------------------- |
| 104 | + prod: |
| 105 | + needs: |
| 106 | + - configure |
| 107 | + - mods |
| 108 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master |
| 109 | + with: |
| 110 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 111 | + run_tests: false |
| 112 | + upload_artifact: true |
| 113 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 114 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 115 | + stage: prod |
| 116 | + stage_prev: mods |
| 117 | + |
| 118 | + prod-test: |
| 119 | + needs: |
| 120 | + - configure |
| 121 | + - prod |
| 122 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master |
| 123 | + with: |
| 124 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 125 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 126 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 127 | + stage: prod |
| 128 | + |
| 129 | + |
| 130 | + # ----------------------------------------------------------------------------------------------- |
| 131 | + # (6/8) Build & Test work |
| 132 | + # ----------------------------------------------------------------------------------------------- |
| 133 | + work: |
| 134 | + needs: |
| 135 | + - configure |
| 136 | + - prod |
| 137 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-build.yml@master |
| 138 | + with: |
| 139 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 140 | + run_tests: true |
| 141 | + upload_artifact: true |
| 142 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 143 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 144 | + stage: work |
| 145 | + stage_prev: prod |
| 146 | + |
| 147 | + work-test: |
| 148 | + needs: |
| 149 | + - configure |
| 150 | + - work |
| 151 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-test.yml@master |
| 152 | + with: |
| 153 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 154 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 155 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 156 | + stage: work |
| 157 | + |
| 158 | + |
| 159 | + # ----------------------------------------------------------------------------------------------- |
| 160 | + # (7/8) Push images |
| 161 | + # ----------------------------------------------------------------------------------------------- |
| 162 | + push-base: |
| 163 | + needs: |
| 164 | + - configure |
| 165 | + - base-test |
| 166 | + - prod-test |
| 167 | + - mods-test |
| 168 | + - work-test |
| 169 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master |
| 170 | + with: |
| 171 | + can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }} |
| 172 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 173 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 174 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 175 | + stage: base |
| 176 | + secrets: |
| 177 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 178 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 179 | + |
| 180 | + push-mods: |
| 181 | + needs: |
| 182 | + - configure |
| 183 | + - base-test |
| 184 | + - prod-test |
| 185 | + - mods-test |
| 186 | + - work-test |
| 187 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master |
| 188 | + with: |
| 189 | + can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }} |
| 190 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 191 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 192 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 193 | + stage: mods |
| 194 | + secrets: |
| 195 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 196 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 197 | + |
| 198 | + push-prod: |
| 199 | + needs: |
| 200 | + - configure |
| 201 | + - base-test |
| 202 | + - prod-test |
| 203 | + - mods-test |
| 204 | + - work-test |
| 205 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master |
| 206 | + with: |
| 207 | + can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }} |
| 208 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 209 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 210 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 211 | + stage: prod |
| 212 | + secrets: |
| 213 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 214 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 215 | + |
| 216 | + push-work: |
| 217 | + needs: |
| 218 | + - configure |
| 219 | + - base-test |
| 220 | + - prod-test |
| 221 | + - mods-test |
| 222 | + - work-test |
| 223 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-push-image.yml@master |
| 224 | + with: |
| 225 | + can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }} |
| 226 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 227 | + matrix: ${{ needs.configure.outputs.matrix_build }} |
| 228 | + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} |
| 229 | + stage: work |
| 230 | + secrets: |
| 231 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 232 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 233 | + |
| 234 | + |
| 235 | + # ----------------------------------------------------------------------------------------------- |
| 236 | + # (8/8) Push Manifests |
| 237 | + # ----------------------------------------------------------------------------------------------- |
| 238 | + manifest-base: |
| 239 | + needs: |
| 240 | + - configure |
| 241 | + - push-base |
| 242 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master |
| 243 | + with: |
| 244 | + can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }} |
| 245 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 246 | + matrix: ${{ needs.configure.outputs.matrix_deploy }} |
| 247 | + versions: ${{ needs.configure.outputs.versions }} |
| 248 | + stage: base |
| 249 | + secrets: |
| 250 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 251 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 252 | + |
| 253 | + manifest-mods: |
| 254 | + needs: |
| 255 | + - configure |
| 256 | + - push-mods |
| 257 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master |
| 258 | + with: |
| 259 | + can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }} |
| 260 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 261 | + matrix: ${{ needs.configure.outputs.matrix_deploy }} |
| 262 | + versions: ${{ needs.configure.outputs.versions }} |
| 263 | + stage: mods |
| 264 | + secrets: |
| 265 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 266 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 267 | + |
| 268 | + manifest-prod: |
| 269 | + needs: |
| 270 | + - configure |
| 271 | + - push-prod |
| 272 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master |
| 273 | + with: |
| 274 | + can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }} |
| 275 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 276 | + matrix: ${{ needs.configure.outputs.matrix_deploy }} |
| 277 | + versions: ${{ needs.configure.outputs.versions }} |
| 278 | + stage: prod |
| 279 | + secrets: |
| 280 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 281 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
| 282 | + |
| 283 | + manifest-work: |
| 284 | + needs: |
| 285 | + - configure |
| 286 | + - push-work |
| 287 | + uses: devilbox/github-actions/.github/workflows/docker-multistage-push-manifest.yml@master |
| 288 | + with: |
| 289 | + can_deploy: ${{ needs.configure.outputs.can_login == 'true' && needs.configure.outputs.can_push == 'true' }} |
| 290 | + has_refs: ${{ needs.configure.outputs.has_refs == 'true' }} |
| 291 | + matrix: ${{ needs.configure.outputs.matrix_deploy }} |
| 292 | + versions: ${{ needs.configure.outputs.versions }} |
| 293 | + stage: work |
| 294 | + secrets: |
| 295 | + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 296 | + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} |
0 commit comments