Merge pull request #46 from fiap-soat-tech-challenge/fix_route_cozinha #102
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Apply Infra" | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'infra/**' | |
env: | |
TF_CLOUD_ORGANIZATION: "fiap_postech" | |
TF_API_TOKEN: "${{ secrets.TF_API_TOKEN }}" | |
TF_WORKSPACE: "cluster-infra" | |
CONFIG_DIRECTORY: "./infra" | |
jobs: | |
terraform: | |
name: "Apply" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Upload Configuration | |
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0 | |
id: apply-upload | |
with: | |
workspace: ${{ env.TF_WORKSPACE }} | |
directory: ${{ env.CONFIG_DIRECTORY }} | |
- name: Create Apply Run | |
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.0.0 | |
id: apply-run | |
with: | |
workspace: ${{ env.TF_WORKSPACE }} | |
configuration_version: ${{ steps.apply-upload.outputs.configuration_version_id }} | |
- name: Apply | |
uses: hashicorp/tfc-workflows-github/actions/apply-run@v1.0.0 | |
if: fromJSON(steps.apply-run.outputs.payload).data.attributes.actions.IsConfirmable | |
id: apply | |
with: | |
run: ${{ steps.apply-run.outputs.run_id }} | |
comment: "Apply Run from GitHub Actions CI ${{ github.sha }}" |