From 5f8551e7427da315923ca2af5e9d45bb6b011c40 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sat, 26 Mar 2022 13:47:53 +0100 Subject: [PATCH] Finalize new pipelines --- .../{build.yml => action_branch.yml} | 0 .github/workflows/action_pull_request.yml | 174 ++++++++++++++++++ .github/workflows/action_schedule.yml | 174 ++++++++++++++++++ 3 files changed, 348 insertions(+) rename .github/workflows/{build.yml => action_branch.yml} (100%) create mode 100644 .github/workflows/action_pull_request.yml create mode 100644 .github/workflows/action_schedule.yml diff --git a/.github/workflows/build.yml b/.github/workflows/action_branch.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/action_branch.yml diff --git a/.github/workflows/action_pull_request.yml b/.github/workflows/action_pull_request.yml new file mode 100644 index 0000000..1ec8acb --- /dev/null +++ b/.github/workflows/action_pull_request.yml @@ -0,0 +1,174 @@ +--- + +# ------------------------------------------------------------------------------------------------- +# Job Name +# ------------------------------------------------------------------------------------------------- +name: build + + +# ------------------------------------------------------------------------------------------------- +# When to run +# ------------------------------------------------------------------------------------------------- +on: + pull_request: + + +jobs: + + # ----------------------------------------------------------------------------------------------- + # (1/8) Determine parameter settings + # ----------------------------------------------------------------------------------------------- + params: + uses: ./.github/workflows/params.yml + # Only run for forks (contributor) + if: github.event.pull_request.head.repo.fork + + + # ----------------------------------------------------------------------------------------------- + # (2/8) Configure Build and Deploy Matrices + # ----------------------------------------------------------------------------------------------- + configure: + needs: [params] + uses: ./.github/workflows/zzz-reuse-configure.yml + with: + enabled: true + can_deploy: false + matrix: ${{ needs.params.outputs.matrix }} + refs: ${{ needs.params.outputs.refs }} + secrets: + dockerhub_username: "" + dockerhub_password: "" + + + # ----------------------------------------------------------------------------------------------- + # (3/8) Build & Test base + # ----------------------------------------------------------------------------------------------- + base: + needs: + - params + - configure + uses: ./.github/workflows/zzz-reuse-build.yml + with: + enabled: true + can_deploy: false + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + flavour: base + secrets: + dockerhub_username: "" + dockerhub_password: "" + + + # ----------------------------------------------------------------------------------------------- + # (4/8) Build & Test mods + # ----------------------------------------------------------------------------------------------- + mods: + needs: + - params + - configure + - base + uses: ./.github/workflows/zzz-reuse-build.yml + with: + enabled: true + can_deploy: false + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + flavour: mods + secrets: + dockerhub_username: "" + dockerhub_password: "" + + + # ----------------------------------------------------------------------------------------------- + # (5/8) Build & Test prod + # ----------------------------------------------------------------------------------------------- + prod: + needs: + - params + - configure + - base + - mods + uses: ./.github/workflows/zzz-reuse-build.yml + with: + enabled: true + can_deploy: false + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + flavour: prod + secrets: + dockerhub_username: "" + dockerhub_password: "" + + + # ----------------------------------------------------------------------------------------------- + # (6/8) Build & Test work + # ----------------------------------------------------------------------------------------------- + work: + needs: + - params + - configure + - base + - mods + - prod + uses: ./.github/workflows/zzz-reuse-build.yml + with: + enabled: true + can_deploy: false + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + flavour: work + secrets: + dockerhub_username: "" + dockerhub_password: "" + + + # ----------------------------------------------------------------------------------------------- + # (7/8) Push images + # ----------------------------------------------------------------------------------------------- + push-image: + needs: + - params + - configure + - base + - mods + - prod + - work + uses: ./.github/workflows/zzz-reuse-deploy-images.yml + with: + enabled: true + can_deploy: false + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + secrets: + dockerhub_username: "" + dockerhub_password: "" + + + # ----------------------------------------------------------------------------------------------- + # (8/8) Push Manifests + # ----------------------------------------------------------------------------------------------- + push-manifest: + needs: + - params + - configure + - base + - mods + - prod + - work + - push-image + uses: ./.github/workflows/zzz-reuse-deploy-manifests.yml + with: + enabled: true + can_deploy: false + deploy_matrix: ${{ needs.configure.outputs.matrix_deploy }} + params_matrix: ${{ needs.params.outputs.matrix }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + secrets: + dockerhub_username: "" + dockerhub_password: "" diff --git a/.github/workflows/action_schedule.yml b/.github/workflows/action_schedule.yml new file mode 100644 index 0000000..f517cd7 --- /dev/null +++ b/.github/workflows/action_schedule.yml @@ -0,0 +1,174 @@ +--- + +# ------------------------------------------------------------------------------------------------- +# Job Name +# ------------------------------------------------------------------------------------------------- +name: nightly + + +# ------------------------------------------------------------------------------------------------- +# When to run +# ------------------------------------------------------------------------------------------------- +on: + # Runs daily + schedule: + - cron: '0 0 * * *' + + +jobs: + + # ----------------------------------------------------------------------------------------------- + # (1/8) Determine parameter settings + # ----------------------------------------------------------------------------------------------- + params: + uses: ./.github/workflows/params.yml + + + # ----------------------------------------------------------------------------------------------- + # (2/8) Configure Build and Deploy Matrices + # ----------------------------------------------------------------------------------------------- + configure: + needs: [params] + uses: ./.github/workflows/zzz-reuse-configure.yml + with: + enabled: true + can_deploy: true + matrix: ${{ needs.params.outputs.matrix }} + refs: ${{ needs.params.outputs.refs }} + secrets: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} + + + # ----------------------------------------------------------------------------------------------- + # (3/8) Build & Test base + # ----------------------------------------------------------------------------------------------- + base: + needs: + - params + - configure + uses: ./.github/workflows/zzz-reuse-build.yml + with: + enabled: true + can_deploy: true + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + flavour: base + secrets: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} + + + # ----------------------------------------------------------------------------------------------- + # (4/8) Build & Test mods + # ----------------------------------------------------------------------------------------------- + mods: + needs: + - params + - configure + - base + uses: ./.github/workflows/zzz-reuse-build.yml + with: + enabled: true + can_deploy: true + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + flavour: mods + secrets: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} + + + # ----------------------------------------------------------------------------------------------- + # (5/8) Build & Test prod + # ----------------------------------------------------------------------------------------------- + prod: + needs: + - params + - configure + - base + - mods + uses: ./.github/workflows/zzz-reuse-build.yml + with: + enabled: true + can_deploy: true + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + flavour: prod + secrets: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} + + + # ----------------------------------------------------------------------------------------------- + # (6/8) Build & Test work + # ----------------------------------------------------------------------------------------------- + work: + needs: + - params + - configure + - base + - mods + - prod + uses: ./.github/workflows/zzz-reuse-build.yml + with: + enabled: true + can_deploy: true + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + flavour: work + secrets: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} + + + # ----------------------------------------------------------------------------------------------- + # (7/8) Push images + # ----------------------------------------------------------------------------------------------- + push-image: + needs: + - params + - configure + - base + - mods + - prod + - work + uses: ./.github/workflows/zzz-reuse-deploy-images.yml + with: + enabled: true + can_deploy: true + build_matrix: ${{ needs.configure.outputs.matrix_build }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + secrets: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }} + + + # ----------------------------------------------------------------------------------------------- + # (8/8) Push Manifests + # ----------------------------------------------------------------------------------------------- + push-manifest: + needs: + - params + - configure + - base + - mods + - prod + - work + - push-image + uses: ./.github/workflows/zzz-reuse-deploy-manifests.yml + with: + enabled: true + can_deploy: true + deploy_matrix: ${{ needs.configure.outputs.matrix_deploy }} + params_matrix: ${{ needs.params.outputs.matrix }} + has_refs: ${{ needs.configure.outputs.has_refs }} + artifact_prefix: ${{ needs.configure.outputs.artifact_prefix }} + secrets: + dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}