Skip to content

Commit

Permalink
Add GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Jun 8, 2024
1 parent 44bf4c5 commit 537378b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/terraform.staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Terraform Staging Workflow
on:
push:
branches:
- "*"

concurrency:
group: merge-${{ github.ref }}

jobs:
terraform:
runs-on: ubuntu-latest
environment: Staging
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'

- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.8.4
terraform_wrapper: false

- name: Terraform Init
run: terraform init

- name: Terraform Workspace
run: terraform workspace select staging

- name: Terraform Apply
run: terraform apply -auto-approve
env:
TF_VAR_region: "asia-southeast1"
TF_VAR_environment: "staging"
TF_VAR_telegram_bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
3 changes: 1 addition & 2 deletions variables.dev.tf → variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
variable "environment" {
type = string
default = "dev"
type = string
}

variable "telegram_bot_token" {
Expand Down

0 comments on commit 537378b

Please sign in to comment.