Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Merge pull request #18 from traP-jp/h24s18 #18

Merge pull request #18 from traP-jp/h24s18

Merge pull request #18 from traP-jp/h24s18 #18

Workflow file for this run

name: "Terraform apply"
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: terraform
jobs:
check_condition:
runs-on: ubuntu-latest
steps:
- name: Check if the branch is main
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
run: exit 1
apply:
needs: check_condition
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.8.4"
- name: Terraform init
run: terraform init
env:
GOOGLE_BACKEND_CREDENTIALS: ${{ secrets.GOOGLE_BACKEND_CREDENTIALS }}
- name: Terraform apply
run: terraform apply -auto-approve
env:
GOOGLE_BACKEND_CREDENTIALS: ${{ secrets.GOOGLE_BACKEND_CREDENTIALS }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}