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
2 changes: 1 addition & 1 deletion .github/workflows/aws_auto_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
if: steps.auth_check.outputs.is_authorized == 'true' && steps.check.outputs.should_release == 'true'
uses: actions/setup-node@v4
with:
node-version: 20.10
node-version: ${{ vars.node_version }}

- name: Calculate new version with cumulative bumps
if: steps.auth_check.outputs.is_authorized == 'true' && steps.check.outputs.should_release == 'true'
Expand Down
41 changes: 33 additions & 8 deletions .github/workflows/aws_dev_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,39 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20.10
node-version: ${{ vars.node_version }}
cache: 'npm'
- run: npm i
- run: CI=false npm run build

- name: Build
run: |
set +e
CI=false npm run build 2>&1 | tee /tmp/build.log
BUILD_EXIT=${PIPESTATUS[0]}
set -e
if [ $BUILD_EXIT -ne 0 ] || grep -q "npm ERR!" /tmp/build.log; then
echo "::error::Build failed"
exit 1
fi

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


- name: Get role ARN
id: get_role
env:
ARN_JSON: ${{ secrets.AWS_ROLE_ARN }}
run: |
arn=$(echo "$ARN_JSON" | jq -r '.dev')
echo "::add-mask::$arn"
echo "arn=$arn" >> $GITHUB_OUTPUT
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::368076259134:role/github-actions-role
role-to-assume: ${{ steps.get_role.outputs.arn }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
Expand All @@ -79,7 +96,7 @@ jobs:
tags: |
type=raw,value=${{ github.event.repository.name }}



- name: Build and push multi-platform images to ECR
uses: docker/build-push-action@v5
Expand All @@ -103,10 +120,18 @@ jobs:
matrix:
service: ${{ fromJson(needs.Build.outputs.service) }}
steps:
- name: Get role ARN
id: get_role
env:
ARN_JSON: ${{ secrets.AWS_ROLE_ARN }}
run: |
arn=$(echo "$ARN_JSON" | jq -r '.dev')
echo "::add-mask::$arn"
echo "arn=$arn" >> $GITHUB_OUTPUT
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::368076259134:role/github-actions-role
role-to-assume: ${{ steps.get_role.outputs.arn }}
aws-region: us-east-1

- name: deploy
Expand Down
44 changes: 35 additions & 9 deletions .github/workflows/aws_prod_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,43 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 20.10
node-version: ${{ vars.node_version }}
cache: 'npm'
- run: git config --global user.email devops@topia.io
- run: git config --global user.name Devops
- run: npm version --no-git-tag-version --workspaces --include-workspace-root true ${{ github.event.release.tag_name }}
- run: npm i
- run: CI=false npm run build

- name: Build
run: |
set +e
CI=false npm run build 2>&1 | tee /tmp/build.log
BUILD_EXIT=${PIPESTATUS[0]}
set -e
if [ $BUILD_EXIT -ne 0 ] || grep -q "npm ERR!" /tmp/build.log; then
echo "::error::Build failed"
exit 1
fi

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


- name: Get role ARN
id: get_role
env:
ARN_JSON: ${{ secrets.AWS_ROLE_ARN }}
run: |
arn=$(echo "$ARN_JSON" | jq -r '.dev')
echo "::add-mask::$arn"
echo "arn=$arn" >> $GITHUB_OUTPUT

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::368076259134:role/github-actions-role
role-to-assume: ${{ steps.get_role.outputs.arn }}
aws-region: us-east-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
Expand Down Expand Up @@ -106,13 +124,21 @@ jobs:
matrix:
service: ${{ fromJson(needs.Build.outputs.service) }}
steps:
- name: Get role ARN
id: get_role
env:
ARN_JSON: ${{ secrets.AWS_ROLE_ARN }}
run: |
arn=$(echo "$ARN_JSON" | jq -r '.prod')
echo "::add-mask::$arn"
echo "arn=$arn" >> $GITHUB_OUTPUT
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::471112828260:role/github-actions-role
role-to-assume: ${{ steps.get_role.outputs.arn }}
aws-region: us-east-1

- 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

Loading
Loading