Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed incorrect environment references in production workflow #419

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ jobs:
outputs:
bucket: ${{ steps.output-bucket-name.outputs.bucket }}
cloudfront_id: ${{ steps.output-cloudfront-distro.outputs.cloudfront_id }}
# env:
# TF_VAR_region: ${{ vars.AWS_REGION }}
# TF_VAR_environment: ${{ vars.ENV_SHORT_NAME }}
# TF_VAR_name_prefix: "tb-${{ vars.PROJECT_SHORT_NAME }}-${{ vars.ENV_SHORT_NAME }}"
# TF_VAR_app_env: ${{ vars.APP_ENV }}
# TF_VAR_db_enc_secret: ${{ vars.DB_ENCRYPTED_SECRET }}
# TF_VAR_frontend_url: ${{ vars.FRONTEND_URL }}
# TF_VAR_fxa_secret: ${{ vars.FXA_SECRET }}
# TF_VAR_google_oauth_secret: ${{ vars.GOOGLE_OAUTH_SECRET }}
# TF_VAR_log_level: ${{ vars.LOG_LEVEL }}
# TF_VAR_short_base_url: ${{ vars.SHORT_BASE_URL }}
# TF_VAR_smtp_secret: ${{ vars.SMTP_SECRET }}
# TF_VAR_zoom_callback: ${{ vars.ZOOM_CALLBACK }}
# TF_VAR_zoom_secret: ${{ vars.zoom_secret }}
# TF_VAR_sentry_dsn: ${{ vars.SENTRY_DSN }}
env:
TF_VAR_region: ${{ vars.AWS_REGION }}
TF_VAR_environment: ${{ vars.ENV_SHORT_NAME }}
TF_VAR_name_prefix: "tb-${{ vars.PROJECT_SHORT_NAME }}-${{ vars.ENV_SHORT_NAME }}"
TF_VAR_app_env: ${{ vars.APP_ENV }}
TF_VAR_db_enc_secret: ${{ vars.DB_ENCRYPTED_SECRET }}
TF_VAR_frontend_url: ${{ vars.FRONTEND_URL }}
TF_VAR_fxa_secret: ${{ vars.FXA_SECRET }}
TF_VAR_google_oauth_secret: ${{ vars.GOOGLE_OAUTH_SECRET }}
TF_VAR_log_level: ${{ vars.LOG_LEVEL }}
TF_VAR_short_base_url: ${{ vars.SHORT_BASE_URL }}
TF_VAR_smtp_secret: ${{ vars.SMTP_SECRET }}
TF_VAR_zoom_callback: ${{ vars.ZOOM_CALLBACK }}
TF_VAR_zoom_secret: ${{ vars.zoom_secret }}
TF_VAR_sentry_dsn: ${{ vars.SENTRY_DSN }}
steps:
- uses: actions/checkout@v4

Expand All @@ -57,39 +57,39 @@ jobs:
terragrunt -v

- name: vpc
working-directory: ./tofu/environments/stage/network/vpc
working-directory: ./tofu/environments/prod/network/vpc
run: |
terragrunt init -upgrade
terragrunt validate
terragrunt plan -out tfplan
# terragrunt apply tfplan # will be re-enabled once release workflow is tested

- name: backend-infra
working-directory: ./tofu/environments/stage/services/backend-infra
working-directory: ./tofu/environments/prod/services/backend-infra
run: |
terragrunt init -upgrade
terragrunt validate
terragrunt plan -out tfplan
# terragrunt apply tfplan # will be re-enabled once release workflow is tested

- name: cache
working-directory: ./tofu/environments/stage/data-store/cache
working-directory: ./tofu/environments/prod/data-store/cache
run: |
terragrunt init -upgrade
terragrunt validate
terragrunt plan -out tfplan
# terragrunt apply tfplan # will be re-enabled once release workflow is tested

- name: database
working-directory: ./tofu/environments/stage/data-store/database
working-directory: ./tofu/environments/prod/data-store/database
run: |
terragrunt init -upgrade
terragrunt validate
terragrunt plan -out tfplan
# terragrunt apply tfplan # will be re-enabled once release workflow is tested

- name: frontend-infra
working-directory: ./tofu/environments/stage/services/frontend-infra
working-directory: ./tofu/environments/prod/services/frontend-infra
run: |
terragrunt init -upgrade
terragrunt validate
Expand All @@ -98,14 +98,14 @@ jobs:

- name: output-bucket-name
id: output-bucket-name
working-directory: ./tofu/environments/stage/services/frontend-infra
working-directory: ./tofu/environments/prod/services/frontend-infra
run: |
output=$(terragrunt output bucket_name | tr -d '"')
echo bucket=$output >> $GITHUB_OUTPUT

- name: output-cloudfront-distro
id: output-cloudfront-distro
working-directory: ./tofu/environments/stage/services/frontend-infra
working-directory: ./tofu/environments/prod/services/frontend-infra
run: |
output=$(terragrunt output cloudfront_id)
echo cloudfront_id=$output >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -136,10 +136,10 @@ jobs:
with:
version: ${{ github.event.release.id }}
file: ecr_tag.txt
target: ./tofu/environments/stage/services/backend-service
target: ./tofu/environments/prod/services/backend-service

- name: Unzip ECR tag
working-directory: ./tofu/environments/stage/services/backend-service
working-directory: ./tofu/environments/prod/services/backend-service
run: unzip ecr_tag.zip

- name: Configure AWS credentials
Expand All @@ -150,7 +150,7 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}

- name: Deploy Backend
working-directory: ./tofu/environments/stage/services/backend-service
working-directory: ./tofu/environments/prod/services/backend-service
run: |
terragrunt init -upgrade
terragrunt validate
Expand Down