Skip to content

Merge pull request #43 from sigstore/dependabot/github_actions/action… #5

Merge pull request #43 from sigstore/dependabot/github_actions/action…

Merge pull request #43 from sigstore/dependabot/github_actions/action… #5

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@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
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 }}