Skip to content

Commit

Permalink
Iterating GH Action Mon Jan 6 03:27:47 PM EST 2025
Browse files Browse the repository at this point in the history
  • Loading branch information
jadudm committed Jan 6, 2025
1 parent f13a88d commit 688eac7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/deploy-to-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
AWS_CONFIG_FILE: "${GITHUB_WORKSPACE}/aws-config"
AWS_SHARED_CREDENTIALS_FILE: "${GITHUB_WORKSPACE}/aws-credentials"
steps:

# This leaves the repository checked out in ${GITHUB_WORKSPACE}.
# So, ${GITHUB_WORKSPACE}/terraform is where the TF lives.
- name: Checkout
uses: actions/checkout@v4

Expand Down Expand Up @@ -62,7 +65,7 @@ jobs:
# https://stackoverflow.com/questions/63048738/how-to-declare-variables-for-s3-backend-in-terraform
- name: Setup TF creds for state bucket
run: |
tee "${REPO}/terraform/${{ inputs.environment }}/backend_${{ inputs.environment }}.config" <<EOF
tee "${GITHUB_WORKSPACE}/terraform/${{ inputs.environment }}/backend_${{ inputs.environment }}.config" <<EOF
bucket="${{ secrets.TF_VAR_BUCKET_NAME }}"
region="${{ secrets.TF_VAR_AWS_DEFAULT_REGION}}"
access_key="${{ secrets.TF_VAR_AWS_ACCESS_KEY_ID }}"
Expand All @@ -72,7 +75,7 @@ jobs:
- name: Setup TF vars for execution
run: |
tee "${REPO}/terraform/${{ inputs.environment }}/terraform.tfvars" <<EOF
tee "${GITHUB_WORKSPACE}/terraform/${{ inputs.environment }}/terraform.tfvars" <<EOF
cf_username = "${{ secrets.CF_USERNAME }}"
cf_password = "${{ secrets.CF_PASSWORD }}"
api_key = "FIXME"
Expand All @@ -95,15 +98,15 @@ jobs:

- name: TF init
run: |
pushd ${REPO}/terraform/${{ inputs.environment }}
pushd ${GITHUB_WORKSPACE}/terraform/${{ inputs.environment }}
terraform init -backend-config="./backend_${{ inputs.environment }}.config" || echo "Failed" && exit
popd
- name: TF plan
uses: dflook/terraform-plan@v1
with:
path: ${REPO}/terraform/${{ inputs.environment }}
backend_config_file: "${REPO}/terraform/${{ inputs.environment }}/backend_${{ inputs.environment}}.config"
path: ${GITHUB_WORKSPACE}/terraform/${{ inputs.environment }}
backend_config_file: "${GITHUB_WORKSPACE}/terraform/${{ inputs.environment }}/backend_${{ inputs.environment}}.config"

# - name: TF apply
# run: |
Expand Down

0 comments on commit 688eac7

Please sign in to comment.