Merge branch 'hashicorp:main' into main #1
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: test-ci-bootstrap | |
# cancel existing runs of the same workflow on the same ref | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- enos/ci/** | |
- .github/workflows/test-ci-bootstrap.yml | |
push: | |
branches: | |
- main | |
paths: | |
- enos/ci/** | |
- .github/workflows/test-ci-bootstrap.yml | |
jobs: | |
bootstrap-ci: | |
runs-on: ubuntu-latest | |
env: | |
TF_WORKSPACE: "${{ github.event.repository.name }}-ci-enos-bootstrap" | |
TF_VAR_repository: ${{ github.event.repository.name }} | |
TF_VAR_aws_ssh_public_key: ${{ secrets.SSH_KEY_PUBLIC_CI }} | |
TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_TOKEN }} | |
steps: | |
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: "1.7.5" # Pin until 1.8.x crash has been resolved | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_CI }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_CI }} | |
aws-region: us-east-1 | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN_CI }} | |
role-skip-session-tagging: true | |
role-duration-seconds: 3600 | |
- name: Init Terraform | |
id: tf_init | |
run: | | |
terraform -chdir=enos/ci/bootstrap init | |
- name: Plan Terraform | |
id: tf_plan | |
run: | | |
terraform -chdir=enos/ci/bootstrap plan | |
- name: Apply Terraform | |
if: ${{ github.ref == 'refs/heads/main' }} | |
id: tf_apply | |
run: | | |
terraform -chdir=enos/ci/bootstrap apply -auto-approve |