chore(deps): update actions/checkout digest to 2d7d9f7 #133
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: 52.Terraform - Keycloak | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- terraform/keycloak/** | |
- .github/workflows/terraform-keycloak.yml | |
pull_request: | |
paths: | |
- terraform/keycloak/** | |
- .github/workflows/terraform-keycloak.yml | |
env: | |
TF_VERSION: 1.5.7 | |
jobs: | |
terraform: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 5 | |
environment: | |
name: tf-keycloak | |
steps: | |
- uses: hmarr/debug-action@f7318c783045ac39ed9bb497e22ce835fdafbfe6 | |
- uses: actions/checkout@2d7d9f7ff5b310f983d059b68785b3c74d8b8edd | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@a0b6ede12c06dbc21b9ea1f225a4121a2f203c69 | |
with: | |
terraform_version: ${{ env.TF_VERSION }} | |
- name: Authenticate and set context | |
uses: redhat-actions/oc-login@dfbd9912672664f9df2023c1c16e07bcf306043c | |
with: | |
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} | |
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} | |
namespace: ${{ vars.OPENSHIFT_NAMESPACE }} | |
insecure_skip_tls_verify: true | |
- name: Terraform Format | |
id: fmt | |
run: terraform fmt -check | |
working-directory: ./terraform/keycloak | |
- name: Terraform Variables | |
run: | | |
cat >"ci.auto.tfvars" <<EOF | |
dev_client_secret = "${{ secrets.DEV_CLIENT_SECRET }}" | |
test_client_secret = "${{ secrets.TEST_CLIENT_SECRET }}" | |
prod_client_secret = "${{ secrets.PROD_CLIENT_SECRET }}" | |
EOF | |
working-directory: ./terraform/keycloak | |
- name: Terraform Init | |
id: init | |
run: terraform init -upgrade | |
working-directory: ./terraform/keycloak | |
- name: Terraform Plan | |
id: plan | |
if: github.event_name == 'pull_request' | |
run: terraform plan -no-color | |
working-directory: ./terraform/keycloak | |
continue-on-error: true | |
- name: Create Comment | |
uses: actions/github-script@35b1cdd1b2c1fc704b1cd9758d10f67e833fcb02 | |
if: github.event_name == 'pull_request' | |
env: | |
PLAN: "terraform\n${{ steps.plan.outputs.stdout }}" | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\` | |
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\` | |
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\` | |
<details><summary>Show Plan</summary> | |
\`\`\`${process.env.PLAN}\`\`\` | |
</details> | |
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`; | |
github.rest.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: output | |
}) | |
- name: Terraform Plan Status | |
if: steps.plan.outcome == 'failure' | |
run: exit 1 | |
- name: Terraform Apply | |
if: github.event_name == 'push' | |
run: terraform apply -auto-approve | |
working-directory: ./terraform/keycloak |