Skip to content

Merge pull request #69 from sigstore/dependabot/terraform/iac/all-9a2… #29

Merge pull request #69 from sigstore/dependabot/terraform/iac/all-9a2…

Merge pull request #69 from sigstore/dependabot/terraform/iac/all-9a2… #29

Workflow file for this run

# Copyright 2024 The Sigstore Authors
# SPDX-License-Identifier: Apache-2.0
name: deploy-terraform
on:
push:
branches:
- "main"
workflow_dispatch:
concurrency: deploy
jobs:
deploy:
runs-on: ubuntu-latest
if: github.repository == 'sigstore/sigstore-devops-tools'
permissions:
contents: read # clone the repository contents
id-token: write # federates with GCP
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: './go.mod'
check-latest: true
- uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7
id: auth
with:
workload_identity_provider: "projects/801815070094/locations/global/workloadIdentityPools/tooling-pool/providers/github-actions-provider"
service_account: "[email protected]"
# Attempt to deploy the terraform configuration
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v2.0.0
with:
terraform_version: '1.9'
- working-directory: ./iac
run: |
terraform init
terraform plan -out=plan.out
terraform apply -auto-approve "plan.out"
- uses: rtCamp/action-slack-notify@c33737706dea87cd7784c687dadc9adf1be59990 # v2.3.2
if: ${{ failure() }}
env:
SLACK_ICON: http://github.com/chainguard-dev.png?size=48
SLACK_USERNAME: guardian
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: 'sigstore-devops-tools-alerts' # Use a channel
SLACK_COLOR: '#8E1600'
MSG_MINIMAL: 'true'
SLACK_TITLE: Deploying sigstore-devops-tools failed
SLACK_MESSAGE: |
For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}