Skip to content

Commit

Permalink
Merge branch 'dev' into simplify-tf-module-structure
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/ci-iac.yml
#	.github/workflows/deploy.yml
#	terraform-iac/cpy/app/cpy-app.tf
#	terraform-iac/cpy/setup/.terraform.lock.hcl
#	terraform-iac/cpy/setup/cpy-setup.tf
#	terraform-iac/dev/app/.terraform.lock.hcl
#	terraform-iac/dev/app/dev-app.tf
#	terraform-iac/dev/setup/.terraform.lock.hcl
#	terraform-iac/dev/setup/dev-setup.tf
#	terraform-iac/prd/app/.terraform.lock.hcl
#	terraform-iac/prd/app/prd-app.tf
#	terraform-iac/prd/setup/prd-setup.tf
#	terraform-iac/stg/app/.terraform.lock.hcl
#	terraform-iac/stg/app/stg-app.tf
#	terraform-iac/stg/setup/.terraform.lock.hcl
#	terraform-iac/stg/setup/stg-setup.tf
#	terraform/app/.terraform.lock.hcl
#	terraform/setup/.terraform.lock.hcl
  • Loading branch information
GaryGSC committed Feb 8, 2024
2 parents 454def2 + fae42d2 commit 570809e
Show file tree
Hide file tree
Showing 10 changed files with 1,449 additions and 1,210 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/ci-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
cache: npm
Expand All @@ -37,7 +37,7 @@ jobs:
run: npm test

- name: Report test coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
if: env.CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -47,10 +47,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

Expand All @@ -65,10 +65,10 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
cache: npm
Expand All @@ -87,21 +87,15 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- uses: actions/checkout@v4

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: docker build
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: src
platforms: linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

Expand All @@ -110,7 +104,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Hadolint follows semantic versioning, but doesn't have a @v2 release
- name: Lint Dockerfile
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-iac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- '.github/workflows/ci-iac.yml'

env:
tf_version: "1.5.3" # must match value in terraform/app/main.tf
tf_version: "1.7.0" # must match value in terraform-iac/*/app/main.tf

jobs:
env:
Expand Down Expand Up @@ -72,10 +72,10 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Terraform Setup
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.tf_version }}

Expand All @@ -97,17 +97,17 @@ jobs:
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "arn:aws:iam::${{ matrix.env.aws_account }}:role/${{ matrix.env.aws_gha_role }}"
role-session-name: ${{ github.sha }}
aws-region: us-west-2

- name: Terraform Setup
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.tf_version }}

Expand Down
40 changes: 17 additions & 23 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- '.gitignore'
env:
node_version: "18.x"
tf_version: "1.5.3" # must match value in terraform/app/main.tf
tf_version: "1.7.0" # must match value in terraform-iac/*/app/main.tf
FORCE_COLOR: 3
concurrency: ${{ github.ref }}
jobs:
Expand Down Expand Up @@ -94,10 +94,10 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
cache: npm
Expand All @@ -112,7 +112,7 @@ jobs:
run: npm test

- name: Report test coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
if: env.CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -122,10 +122,10 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

Expand All @@ -140,10 +140,10 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
cache: npm
Expand All @@ -162,7 +162,7 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Hadolint follows semantic versioning, but doesn't have a @v2 release
- name: Lint Dockerfile
Expand All @@ -175,10 +175,10 @@ jobs:
timeout-minutes: 3
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Terraform Setup
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.tf_version }}

Expand All @@ -202,47 +202,41 @@ jobs:
contents: read
steps:
- name: Check out
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "arn:aws:iam::${{ matrix.env.aws_account }}:role/${{ matrix.env.aws_gha_role }}"
role-session-name: ${{ github.sha }}
aws-region: us-west-2

- name: Log into Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2

- name: Get Current Timestamp
id: date
run: echo "timestamp=$(date +'%Y-%m-%d_%H-%M-%S')" >> $GITHUB_OUTPUT

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build and push the Docker image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPO: ${{ matrix.env.ecr_repo_name }}
IMAGE_TAG: ${{ steps.date.outputs.timestamp }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: src
platforms: linux/arm64
push: true
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPO}}:${{ env.IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Terraform Setup
uses: hashicorp/setup-terraform@v2
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.tf_version }}
terraform_wrapper: false
Expand Down
2 changes: 1 addition & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.17.0-slim
FROM node:18.19.0-slim
WORKDIR /usr/app

COPY package*.json ./
Expand Down
Loading

0 comments on commit 570809e

Please sign in to comment.