Skip to content

Commit

Permalink
fix working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
wrnu committed Sep 27, 2023
1 parent 64ed461 commit 276db26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: terraform plan ecr
env:
TF_VAR_read_principals: ${{ vars.AWS_ACCOUNTS_ECR_READ_ACCESS }}
working-directory: src/terraform/ecr
run: |
cd src/terraform/ecr
cat <<EOF > backend.hcl
bucket = "${{ vars.S3_BACKEND_NAME }}"
key = "startup-sample-app-aws-containers-ecr.tfstate"
Expand Down Expand Up @@ -93,8 +93,8 @@ jobs:
env:
TF_VAR_target_env: ${{ env.environment }}
TF_VAR_app_image: ${{ env.IMAGE_ID }}:${{ github.sha }}
working-directory: src/terraform/app
run: |
cd src/terraform/app
cat <<EOF > backend.hcl
bucket = "${{ vars.S3_BACKEND_NAME }}"
key = "startup-sample-app-aws-containers.tfstate"
Expand All @@ -105,7 +105,7 @@ jobs:
terraform plan
- name: Build the front-end
working-directory: src/web
run: |
cd src/web
npm install
npm run build
6 changes: 3 additions & 3 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
- name: terraform plan ecr
env:
TF_VAR_read_principals: ${{ vars.AWS_ACCOUNTS_ECR_READ_ACCESS }}
working-directory: src/terraform/ecr
run: |
cd src/terraform/ecr
cat <<EOF > backend.hcl
bucket = "${{ vars.S3_BACKEND_NAME }}"
key = "startup-sample-app-aws-containers-ecr.tfstate"
Expand Down Expand Up @@ -101,8 +101,8 @@ jobs:
env:
TF_VAR_target_env: ${{ env.environment }}
TF_VAR_app_image: ${{ env.IMAGE_ID }}:${{ github.sha }}
working-directory: src/terraform/app
run: |
cd src/terraform/app
cat <<EOF > backend.hcl
bucket = "${{ vars.S3_BACKEND_NAME }}"
key = "startup-sample-app-aws-containers.tfstate"
Expand All @@ -114,14 +114,14 @@ jobs:
- name: Extract outputs from Terraform
id: tf-outputs
working-directory: src/terraform/app
run: |
terraform output -json > outputs.json
cat outputs.json
echo "S3_BUCKET_ARN=$(jq -r .s3_bucket_arn.value outputs.json)" >> $GITHUB_ENV
echo "CF_DOMAIN=$(jq -r .cloudfront.value.domain_name outputs.json)" >> $GITHUB_ENV
echo "CF_DISTRIBUTION_ID=$(jq -r .cloudfront.value.distribution_id outputs.json)" >> $GITHUB_ENV
echo "API_GW_URL=$(jq -r .apigw_url.value outputs.json)" >> $GITHUB_ENV
working-directory: src/terraform
- name: Build and deploy the front-end
run: |
Expand Down

0 comments on commit 276db26

Please sign in to comment.