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