Skip to content

Commit f03c7d6

Browse files
committed
CCM-11751: Package and publish modules to Github on release cut
1 parent 01d3441 commit f03c7d6

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Github Release Created
2+
3+
on:
4+
release:
5+
types: ["published"] # Inherits all input defaults
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: false
10+
11+
jobs:
12+
deploy-main:
13+
name: Deploy changes to main in nonprod AWS Account
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v5.0.0
23+
24+
- name: "Package and Publish Terraform modules"
25+
run: |
26+
cd infrastructure/modules
27+
for module in */; do
28+
module_name=${module%/}
29+
echo "Zipping contents of $module_name..."
30+
(cd "$module_name" && zip -r "../../../artifacts/terraform-${module_name}.zip" .)
31+
echo "Publishing $module_name module..."
32+
gh release upload ${{ github.event.release.tag_name }} "../../artifacts/terraform-${module_name}.zip" --clobber
33+
done
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)