Skip to content

Commit

Permalink
Merge pull request #5 from HexCoderTech/release
Browse files Browse the repository at this point in the history
Create release.yml
  • Loading branch information
gnomezgrave authored Mar 10, 2024
2 parents e994411 + 6f6f3ce commit 5aa6ab3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release to Prod

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

0 comments on commit 5aa6ab3

Please # to comment.