Skip to content

Bump follow-redirects from 1.15.2 to 1.15.4 in /src/web #14

Bump follow-redirects from 1.15.2 to 1.15.4 in /src/web

Bump follow-redirects from 1.15.2 to 1.15.4 in /src/web #14

Workflow file for this run

name: Pull Request
on:
pull_request:
branches: [main, dev, test]
env:
TF_VERSION: 1.5.7
IMAGE_ID: ${{ vars.AWS_ECR_URI }}
permissions:
id-token: write # This is required for requesting the JWT and AWS credentials using AssumeRoleWithWebIdentity
contents: read # This is required for actions/checkout
jobs:
env_selector:
runs-on: ubuntu-latest
steps:
- name: env selector
id: identify
run: |
if [ ${GITHUB_BASE_REF} = "main" ];then export github_env='prod'; else export github_env=${GITHUB_BASE_REF}; fi
echo "name=${github_env}" >> "$GITHUB_ENV"
outputs:
github_env: ${{ env.name }}
terraform_plan_ecr:
name: terraform plan ecr
environment: tools
runs-on: ubuntu-22.04
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ vars.TERRAFORM_DEPLOY_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
- name: terraform plan ecr
env:
TF_VAR_read_principals: ${{ vars.AWS_ACCOUNTS_ECR_READ_ACCESS }}
working-directory: src/terraform/ecr
run: |
cat <<EOF > backend.hcl
bucket = "${{ vars.S3_BACKEND_NAME }}"
key = "startup-sample-app-aws-containers-ecr.tfstate"
dynamodb_table = "${{ vars.DYNAMO_DB_TABLE_NAME }}"
EOF
terraform init -backend-config=backend.hcl
terraform plan
docker_build:
name: docker build
runs-on: ubuntu-22.04
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
id: docker_build
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: src/api
file: src/api/Dockerfile
push: false
terraform_plan_app:
name: terraform plan app
runs-on: ubuntu-latest
needs: env_selector
environment: ${{ needs.env_selector.outputs.github_env }}
steps:
- name: checkout the repo and building the Backend
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ vars.TERRAFORM_DEPLOY_ROLE_ARN }}
aws-region: ca-central-1
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ env.TF_VERSION }}
- name: terraform plan app
env:
TF_VAR_target_env: ${{ needs.env_selector.outputs.github_env }}
TF_VAR_app_image: ${{ env.IMAGE_ID }}:${{ github.sha }}
working-directory: src/terraform/app
run: |
cat <<EOF > backend.hcl
bucket = "${{ vars.S3_BACKEND_NAME }}"
key = "startup-sample-app-aws-containers.tfstate"
dynamodb_table = "${{ vars.DYNAMO_DB_TABLE_NAME }}"
EOF
terraform init -backend-config=backend.hcl
terraform plan
- name: Build the front-end
working-directory: src/web
run: |
npm install
npm run build