Merge pull request #49 from sigstore/dependabot/go_modules/gomod-1fd8… #10
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
# 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version: '1.22' | |
check-latest: true | |
- uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa # v2.1.3 | |
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@651471c36a6092792c552e8b1bef71e592b462d8 # v2.0.0 | |
with: | |
terraform_version: 1.8 | |
- working-directory: ./iac | |
run: | | |
terraform init | |
terraform plan -out=plan.out | |
terraform apply -auto-approve "plan.out" | |
- uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907 # v2.3.0 | |
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 }} |