From 6a052a57edbe8d41c3aece11cc9215ad6f30f7bf Mon Sep 17 00:00:00 2001 From: Praneeth Peiris Date: Sun, 10 Mar 2024 17:28:00 +0100 Subject: [PATCH 1/2] Create release.yml --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1468f35 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Pull Request CD + +on: + release: + types: + - "released" + +jobs: + terraform: + name: terraform + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: hashicorp/setup-terraform@v3 + - name: Terraform + id: credentials + run: | + # Get GCP credentials + echo "${KEY}" | base64 -d > ~/key.json + export GOOGLE_APPLICATION_CREDENTIALS=~/key.json + cd terraform + terraform init && terraform validate + terraform workspace new prod || terraform workspace select prod + terraform apply -auto-approve + env: + KEY: ${{secrets.SERVICE_ACCOUNT}} + GOOGLE_APPLICATION_CREDENTIALS: ~/key.json \ No newline at end of file From 6b321118a177b4eeb0646e576a4ddd081efaa436 Mon Sep 17 00:00:00 2001 From: Praneeth Peiris Date: Sun, 10 Mar 2024 17:28:44 +0100 Subject: [PATCH 2/2] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1468f35..3b5e94d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Pull Request CD +name: Release to Prod on: release: