forked from blockscout/blockscout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ccrayz
authored and
ccrayz
committed
Jun 14, 2024
1 parent
c31f937
commit c3ab8e1
Showing
18 changed files
with
104 additions
and
980 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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Selectable Environment CICD | ||
run-name: Deploy to ${{ github.event.inputs.environment }} by @${{ github.actor }} | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: "Select Environment" | ||
type: choice | ||
required: true | ||
options: | ||
- "devnet" | ||
- "sepolia" | ||
- "mainnet" | ||
env: | ||
APP_NAME: blockscout-v3 | ||
IMAGE_NAME: blockscout-v3 | ||
NAMESPACE: kroma-ecosystem | ||
|
||
jobs: | ||
ci: | ||
environment: ${{ github.event.inputs.environment }} | ||
runs-on: ubuntu-latest | ||
outputs: | ||
IMAGE_TAG: ${{ steps.predefined.outputs.IMAGE_TAG }} | ||
|
||
steps: | ||
- name: Check out source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Predefined | ||
id: predefined | ||
run: echo "IMAGE_TAG=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_OUTPUT | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::${{ secrets.ACCOUNT_ID }}:role/${{ secrets.KROMA_GITHUB_ACTION_ROLE }} | ||
aws-region: ap-northeast-2 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Publish Kroma Blockscout V2 Backend | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./docker/Dockerfile | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: true | ||
tags: ${{ secrets.AWS_ECR_REPOSITORY }}/blockscout-v3:${{ steps.predefined.outputs.IMAGE_TAG }},${{ secrets.AWS_ECR_REPOSITORY }}/blockscout-v3:latest | ||
platforms: linux/amd64 | ||
build-args: | | ||
CACHE_EXCHANGE_RATES_PERIOD= | ||
API_V1_READ_METHODS_DISABLED=false | ||
DISABLE_WEBAPP=false | ||
API_V1_WRITE_METHODS_DISABLED=false | ||
CACHE_TOTAL_GAS_USAGE_COUNTER_ENABLED= | ||
ADMIN_PANEL_ENABLED=false | ||
DECODE_NOT_A_CONTRACT_CALLS=false | ||
MIXPANEL_URL= | ||
MIXPANEL_TOKEN= | ||
AMPLITUDE_URL= | ||
AMPLITUDE_API_KEY= | ||
CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL= | ||
BLOCKSCOUT_VERSION=v5.2.2-beta | ||
RELEASE_VERSION=5.2.2 | ||
cd: | ||
needs: ci | ||
environment: ${{ github.event.inputs.environment }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Target Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kroma-network/devops-helm | ||
ref: main | ||
token: ${{ secrets.KROMA_GIT_TOKEN }} | ||
|
||
- name: Update Image Tag | ||
uses: mikefarah/yq@master | ||
with: | ||
cmd: | | ||
yq -i '.backend.image.tag = "${{ needs.ci.outputs.IMAGE_TAG }}"' '${{ env.NAMESPACE }}/${{ env.APP_NAME }}/${{ secrets.CLUSTER }}.yaml' | ||
- name: Push Changed Image Tag | ||
run: | | ||
git config --global user.email lightscale@lightscale.io | ||
git config --global user.name lightscale | ||
if [ -z "$(git status --porcelain)" ] | ||
then | ||
echo "Nothing to commit, working directory clean" | ||
else | ||
git commit -am "${{ env.APP_NAME }} ${{ needs.ci.outputs.IMAGE_TAG }}" && git push | ||
fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.