From f03c7d6c588e96b6d0ad435cde741980efc0187e Mon Sep 17 00:00:00 2001 From: sidnhs Date: Wed, 3 Sep 2025 15:08:30 +0100 Subject: [PATCH 1/2] CCM-11751: Package and publish modules to Github on release cut --- .github/workflows/release_created.yaml | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/release_created.yaml diff --git a/.github/workflows/release_created.yaml b/.github/workflows/release_created.yaml new file mode 100644 index 0000000..bc05dd4 --- /dev/null +++ b/.github/workflows/release_created.yaml @@ -0,0 +1,35 @@ +name: Github Release Created + +on: + release: + types: ["published"] # Inherits all input defaults + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + deploy-main: + name: Deploy changes to main in nonprod AWS Account + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v5.0.0 + + - name: "Package and Publish Terraform modules" + run: | + cd infrastructure/modules + for module in */; do + module_name=${module%/} + echo "Zipping contents of $module_name..." + (cd "$module_name" && zip -r "../../../artifacts/terraform-${module_name}.zip" .) + echo "Publishing $module_name module..." + gh release upload ${{ github.event.release.tag_name }} "../../artifacts/terraform-${module_name}.zip" --clobber + done + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3e19e0addb4d875c84c7e2227b8413ab7729b902 Mon Sep 17 00:00:00 2001 From: sidnhs Date: Wed, 3 Sep 2025 15:12:03 +0100 Subject: [PATCH 2/2] CCM-11751: Package and publish modules to Github on release cut --- .github/workflows/release_created.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_created.yaml b/.github/workflows/release_created.yaml index bc05dd4..802ef28 100644 --- a/.github/workflows/release_created.yaml +++ b/.github/workflows/release_created.yaml @@ -10,7 +10,7 @@ concurrency: jobs: deploy-main: - name: Deploy changes to main in nonprod AWS Account + name: Package and Publish Terraform Modules to GitHub Releases assets runs-on: ubuntu-latest permissions: