From 6b64570052fadf39d97595adf39de49b8516ed36 Mon Sep 17 00:00:00 2001 From: Adam Vollrath Date: Fri, 7 Jul 2023 00:02:00 -0500 Subject: [PATCH] Draft of Uffizzi Preview action --- .../workflows/call-docker-build-promote.yaml | 14 ++++++++++++++ .github/workflows/call-uffizzi-delete.yaml | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .github/workflows/call-uffizzi-delete.yaml diff --git a/.github/workflows/call-docker-build-promote.yaml b/.github/workflows/call-docker-build-promote.yaml index bc347c7..c6103f8 100644 --- a/.github/workflows/call-docker-build-promote.yaml +++ b/.github/workflows/call-docker-build-promote.yaml @@ -53,6 +53,20 @@ jobs: severity: HIGH,CRITICAL ignore-unfixed: true + preview: + name: Preview + if: github.event_name == 'pull_request' + needs: docker-build-pr + uses: mostlydevops/actions/.github/workflows/reusable-uffizzi.yaml@main + secrets: + github-token: ${{ secrets.GITOPS_WORDSMITH_K8S }} + with: + repo: mostlydevops/wordsmith-k8s + environment-dir: preview-uffizzi + image: ghcr.io/${{ github.repository }} + tag: ${{ needs.docker-build-pr.outputs.image-tag }} + pr-number: ${{ github.event.number }} + #### MERGE TO MAIN #### docker-build-merge: name: Call Build on Push diff --git a/.github/workflows/call-uffizzi-delete.yaml b/.github/workflows/call-uffizzi-delete.yaml new file mode 100644 index 0000000..953a779 --- /dev/null +++ b/.github/workflows/call-uffizzi-delete.yaml @@ -0,0 +1,19 @@ +--- +name: Close Pull Request + +on: + pull_request: + types: [closed] + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + delete-preview: + name: Delete Uffizzi virtual cluster preview + uses: mostlydevops/actions/.github/workflows/reusable-uffizzi-delete.yaml@main + secrets: + github-token: ${{ secrets.GITOPS_WORDSMITH_K8S }} + with: + pr-number: ${{ github.event.number }}