Skip to content

Commit 6da48aa

Browse files
authored
fix: ecs fixed, release ci fixed (#236)
* release & deploy config merged * refactor
1 parent 2284aee commit 6da48aa

File tree

3 files changed

+22
-32
lines changed

3 files changed

+22
-32
lines changed
Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# Copyright 2020 ChainSafe Systems
22
# SPDX-License-Identifier: LGPL-3.0-only
33

4-
name: Build & Deploy PROD
5-
4+
name: Release
65
on:
76
push:
8-
tags:
9-
- 'v*'
10-
workflow_dispatch:
7+
branches:
8+
- main
119

1210
env:
1311
AWS_REGION: ${{ secrets.AWS_REGION }}
@@ -16,40 +14,48 @@ env:
1614
ECS_CLUSTER: ${{ secrets.AWS_ECS_CLUSTER }}
1715
ECS_SERVICE: ${{ secrets.AWS_ECS_SERVICE }}
1816
ENVIRONMENT: PROD
19-
17+
2018
jobs:
21-
build:
22-
name: build_deploy_prod
19+
release-please:
2320
runs-on: ubuntu-latest
2421
permissions:
2522
id-token: write
2623
contents: write
2724

2825
steps:
29-
# download the source code into the runner
26+
- uses: GoogleCloudPlatform/[email protected]
27+
id: release
28+
with:
29+
release-type: go
30+
3031
- name: checkout
3132
uses: actions/checkout@v2
32-
33+
if: ${{ steps.release.outputs.release_created }}
34+
3335
- name: Set output
3436
id: vars
3537
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
36-
38+
if: ${{ steps.release.outputs.release_created }}
39+
3740
- name: Configure AWS credentials
3841
uses: aws-actions/configure-aws-credentials@v1
3942
with:
4043
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/github-actions-role
4144
aws-region: ${{ env.AWS_REGION }}
45+
if: ${{ steps.release.outputs.release_created }}
4246

4347
# gather metadata from git & github actions to reference in docker
4448
- name: git & github metadata
4549
id: metadata
4650
uses: docker/metadata-action@v3
4751
with:
4852
images: ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.AWS_ECR_REPO }}
53+
if: ${{ steps.release.outputs.release_created }}
4954

5055
# login in docker repository
5156
- name: docker login
5257
uses: aws-actions/amazon-ecr-login@v1
58+
if: ${{ steps.release.outputs.release_created }}
5359

5460
# build a docker image
5561
- name: docker & push image
@@ -61,7 +67,8 @@ jobs:
6167
tags: |
6268
${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPO }}:latest
6369
${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPO }}:${{ steps.vars.outputs.tag }}
64-
70+
if: ${{ steps.release.outputs.release_created }}
71+
6572
# deploy to AWS ECS
6673
- name: Deploy to Amazon ECS
6774
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
@@ -70,4 +77,5 @@ jobs:
7077
service: ${{ env.ECS_SERVICE }}
7178
cluster: ${{ env.ECS_CLUSTER }}
7279
wait-for-service-stability: true
73-
80+
if: ${{ steps.release.outputs.release_created }}
81+

.github/workflows/release.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

infra/aws-ecs/task_definition_PROD.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"FARGATE"
8383
],
8484
"cpu": "1024",
85-
"memory": "2024",
85+
"memory": "2048",
8686
"registeredAt": "2022-04-27T15:23:12.288Z",
8787
"registeredBy": "arn:aws:sts::381177214925:assumed-role/AWSReservedSSO_AWSAdministratorAccess_8acb862b989cc854/[email protected]",
8888
"tags": [

0 commit comments

Comments
 (0)