mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #875 from Hestia-Homes/deploy-fastapi-with-terraform
Deploy fastapi with terraform: dont use _deploy_lambda workflow
This commit is contained in:
commit
aade3a42ab
1 changed files with 32 additions and 10 deletions
42
.github/workflows/deploy_terraform.yml
vendored
42
.github/workflows/deploy_terraform.yml
vendored
|
|
@ -351,14 +351,36 @@ jobs:
|
|||
# ============================================================
|
||||
cloudfront_cdn:
|
||||
needs: [determine_stage, shared_terraform, fast_api_lambda]
|
||||
uses: ./.github/workflows/_deploy_lambda.yml
|
||||
with:
|
||||
lambda_name: ara_cdn
|
||||
lambda_path: infrastructure/terraform/cdn
|
||||
stage: ${{ needs.determine_stage.outputs.stage }}
|
||||
terraform_apply: ${{ needs.determine_stage.outputs.terraform_apply }}
|
||||
secrets:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
|
||||
AWS_REGION: ${{ secrets.DEV_AWS_REGION }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
STAGE: ${{ needs.determine_stage.outputs.stage }}
|
||||
TERRAFORM_APPLY: ${{ needs.determine_stage.outputs.terraform_apply }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: ${{ secrets.DEV_AWS_REGION }}
|
||||
|
||||
- uses: hashicorp/setup-terraform@v3
|
||||
|
||||
- name: Terraform Init
|
||||
working-directory: infrastructure/terraform/cdn
|
||||
run: terraform init -reconfigure
|
||||
|
||||
- name: Terraform Workspace
|
||||
working-directory: infrastructure/terraform/cdn
|
||||
run: terraform workspace select ${STAGE} || terraform workspace new ${STAGE}
|
||||
|
||||
- name: Terraform Plan
|
||||
working-directory: infrastructure/terraform/cdn
|
||||
run: terraform plan -var-file=${STAGE}.tfvars -out=tfplan
|
||||
|
||||
- name: Terraform Apply
|
||||
if: env.TERRAFORM_APPLY == 'true'
|
||||
working-directory: infrastructure/terraform/cdn
|
||||
run: terraform apply -auto-approve tfplan
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue