-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Revert "fix: ecs fixed, release ci fixed" (#237)
* Revert "fix: ecs fixed, release ci fixed (#236)" This reverts commit 6da48aa. * Update task_definition_PROD.json
- Loading branch information
Showing
3 changed files
with
32 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# Copyright 2020 ChainSafe Systems | ||
# SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
name: Release | ||
name: Build & Deploy PROD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
workflow_dispatch: | ||
|
||
env: | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
|
@@ -14,48 +16,40 @@ env: | |
ECS_CLUSTER: ${{ secrets.AWS_ECS_CLUSTER }} | ||
ECS_SERVICE: ${{ secrets.AWS_ECS_SERVICE }} | ||
ENVIRONMENT: PROD | ||
|
||
jobs: | ||
release-please: | ||
build: | ||
name: build_deploy_prod | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- uses: GoogleCloudPlatform/[email protected] | ||
id: release | ||
with: | ||
release-type: go | ||
|
||
# download the source code into the runner | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
|
||
- name: Set output | ||
id: vars | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/github-actions-role | ||
aws-region: ${{ env.AWS_REGION }} | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
# gather metadata from git & github actions to reference in docker | ||
- name: git & github metadata | ||
id: metadata | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.AWS_ECR_REPO }} | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
# login in docker repository | ||
- name: docker login | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
# build a docker image | ||
- name: docker & push image | ||
|
@@ -67,8 +61,7 @@ jobs: | |
tags: | | ||
${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPO }}:latest | ||
${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.AWS_REGION }}.amazonaws.com/${{ env.ECR_REPO }}:${{ steps.vars.outputs.tag }} | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
# deploy to AWS ECS | ||
- name: Deploy to Amazon ECS | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v1 | ||
|
@@ -77,5 +70,4 @@ jobs: | |
service: ${{ env.ECS_SERVICE }} | ||
cluster: ${{ env.ECS_CLUSTER }} | ||
wait-for-service-stability: true | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2020 ChainSafe Systems | ||
# SPDX-License-Identifier: LGPL-3.0-only | ||
|
||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GoogleCloudPlatform/[email protected] | ||
id: release | ||
with: | ||
release-type: go | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,4 +99,4 @@ | |
"value": "Nodewatch" | ||
} | ||
] | ||
} | ||
} |