Skip to content
Merged
Show file tree
Hide file tree
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
41 changes: 20 additions & 21 deletions .github/workflows/aws_prod_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ concurrency:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
Build:
runs-on: ubuntu-latest
outputs:
service: ${{ steps.sername.outputs.service }}
steps:

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -55,7 +55,9 @@ jobs:
- run: CI=false npm run build

- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
uses: docker/setup-qemu-action@v3
with:
platforms: arm64,amd64

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -71,6 +73,7 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
driver-opts: image=moby/buildkit:latest

- name: Image Metadata
id: metadata
Expand All @@ -79,26 +82,23 @@ jobs:
images: ${{ steps.login-ecr.outputs.registry }}/${{ env.REPOSITORY }}
tags: |
type=raw,value=${{ github.event.repository.name }}-${{ github.event.release.tag_name }}

- name: Image Metadata
id: metadata-latest
uses: docker/metadata-action@v5
with:
images: ${{ steps.login-ecr.outputs.registry }}/${{ env.REPOSITORY }}
tags: |
type=raw,value=${{ github.event.repository.name }}-latest

- name: Build and version tag
run: |
docker build --build-arg REF=${{ github.ref}} --build-arg COMMIT_HASH=$(git rev-parse --short ${{ github.sha }}) -t ${{ steps.metadata.outputs.tags }} .
docker tag ${{ steps.metadata.outputs.tags }} ${{ steps.metadata-latest.outputs.tags }}

- name: push docker image to Amazon ECR
run: |
docker push ${{ steps.metadata.outputs.tags }}
docker push ${{ steps.metadata-latest.outputs.tags }}
- name: Build and push multi-platform images to ECR
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.metadata.outputs.tags }}
build-args: |
REF=${{ github.ref }}
COMMIT_HASH=${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
sbom: false


deploy_matrix:
runs-on: ubuntu-latest
needs: Build
Expand All @@ -114,5 +114,4 @@ jobs:

- name: deploy
run: |
aws ecs update-service --cluster ${{ env.ECS_Cluster }} --service topia-${{ env.ENV }}-${{ matrix.service }}0 --force-new-deployment

aws ecs update-service --cluster ${{ env.ECS_Cluster }} --service topia-${{ env.ENV }}-${{ matrix.service }}0 --force-new-deployment
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/arm64 node:20.10-alpine3.19
FROM node:20.10-alpine3.19
WORKDIR /app
ARG REF
ARG COMMIT_HASH
Expand Down