Skip to content

Merge pull request #11 from 0bCdian/fix/bucket #6

Merge pull request #11 from 0bCdian/fix/bucket

Merge pull request #11 from 0bCdian/fix/bucket #6

name: OpenTofu Staging Apply Workflow
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TF_VERSION: "1.8.8"
on:
push:
branches:
- main
paths:
- "staging/**"
workflow_dispatch:
jobs:
tofu:
runs-on: ubuntu-latest
environment: staging
permissions:
issues: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Google Auth
id: auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v1
with:
tofu_version: ${{ env.TF_VERSION }}
tofu_wrapper: true
- name: Manual Approval Apply
uses: trstringer/manual-approval@v1
with:
secret: ${{ secrets.GITHUB_TOKEN }}
approvers: "0bCdian"
minimum-approvals: 1
issue-title: "Tofu apply staging approval"
issue-body: "Please approve or deny applying the plan"
exclude-workflow-initiator-as-approver: false
additional-approved-words: ""
additional-denied-words: ""
timeout-minutes: 60
- name: Tofu Init
id: init
run: tofu -chdir="./staging" init -lock=false -input=false
- name: Tofu Apply Staging
id: apply
env:
TF_VAR_project_id: ${{vars.PROJECT_ID}}
TF_VAR_region: ${{vars.REGION}}
if: ${{ success() }}
run: tofu -chdir="./staging" apply -auto-approve -input=false