Skip to content

Initialize release-10 #3

Initialize release-10

Initialize release-10 #3

name: Build and push cliain docker image
on:
push:
paths:
- 'bin/cliain/**'
workflow_dispatch:
jobs:
build-image:
name: Build binary
runs-on: ubuntu-20.04
steps:
- name: GIT | Checkout source code
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.6.1'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo | Build release binary
run: |
cd ./bin/cliain && cargo build --release
- name: GIT | Get branch name and commit SHA
id: get_branch
uses: ./.github/actions/get-branch
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: v0.9.1
- name: Build and push latest docker image
id: build-image
env:
RELEASE_IMAGE: public.ecr.aws/p6e8q1z1/cliain:${{ steps.get_branch.outputs.branch_name == 'main' && 'latest' || steps.get_branch.outputs.branch_name }}
uses: docker/build-push-action@v2
with:
context: ./bin/cliain
builder: ${{ steps.buildx.outputs.name }}
file: ./bin/cliain/Dockerfile
push: true
tags: ${{ env.RELEASE_IMAGE }}