Skip to content

Merge pull request #93 from the-hideout/sha-instead-of-ref #29

Merge pull request #93 from the-hideout/sha-instead-of-ref

Merge pull request #93 from the-hideout/sha-instead-of-ref #29

Workflow file for this run

name: deploy
on:
push:
branches:
- main
permissions:
contents: read
env:
WORKING_DIR: "terraform/"
jobs:
deployment-check:
runs-on: ubuntu-latest
outputs: # set outputs for use in downstream jobs
continue: ${{ steps.deployment-check.outputs.continue }}
steps:
# https://github.com/github/branch-deploy/blob/d3c24bd92505e623615b75ffdfac5ed5259adbdb/docs/merge-commit-strategy.md
- name: deployment check
uses: github/branch-deploy@v9
id: deployment-check
with:
merge_deploy_mode: "true"
environment: production
deploy:
if: ${{ needs.deployment-check.outputs.continue == 'true' && github.event_name == 'push' }}
needs: deployment-check
environment: production
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKING_DIR }}
steps:
- name: checkout
uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # [email protected]
with:
terraform_version: 1.1.7
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- name: Terraform init
run: terraform init
- name: Terraform apply
env:
TF_VAR_CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
run: terraform apply -auto-approve