Add terraform code for wetterdienst project #3
Workflow file for this run
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: Deploy service | |
permissions: | |
contents: read | |
id-token: write | |
on: | |
push: | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
terraform-plan: | |
# needs: [ docker-sync ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Acquire sources | |
uses: actions/checkout@v4 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
- name: Google Auth | |
uses: google-github-actions/auth@v2 | |
with: | |
project_id: wetterdienst | |
workload_identity_provider: projects/867542820543/locations/global/workloadIdentityPools/github/providers/github | |
- name: Terraform init | |
working-directory: ./terraform | |
run: terraform init | |
- name: Terraform plan | |
working-directory: ./terraform | |
run: terraform plan | |
terraform-apply: | |
needs: [ terraform-plan ] | |
# if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Acquire sources | |
uses: actions/checkout@v4 | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v1 | |
- name: Terraform init | |
working-directory: ./terraform | |
run: terraform init | |
- name: Terraform apply | |
working-directory: ./terraform | |
run: terraform apply -auto-approve |