Add step that pushes docker image to ECR #10
Workflow file for this run
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
name: Build and push relayer | |
on: | |
push: | |
branches: | |
- A0-3158-dockerize-relayer | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
runs-on: [self-hosted, Linux, X64, large] | |
env: | |
RUST_BACKTRACE: full | |
RUSTC_WRAPPER: sccache | |
steps: | |
- name: Checkout Source code | |
uses: actions/checkout@v2 | |
- name: Call action get-ref-properties | |
id: get-ref-properties | |
# yamllint disable-line rule:line-length | |
uses: Cardinal-Cryptography/github-actions/get-ref-properties@v6 | |
- name: Install Rust toolchain | |
uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v6 | |
with: | |
targets: wasm32-unknown-unknown | |
- name: Install necessary tools | |
shell: bash | |
run: | | |
npm install typechain | |
cargo install cargo-contract | |
- name: Download files from S3 AWS bucket | |
shell: bash | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_DEVNET_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_DEVNET_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: eu-central-1 | |
run: | | |
mkdir -p azero/artifacts | |
aws s3 cp s3://alephzero-devnet-contracts-test/miko-test/most/425a073ca09f83420218ea1e4fdd3d62036bf4da/relayer/fe_bridgenet/azero_addresses.json azero/addresses.json | |
aws s3 cp s3://alephzero-devnet-contracts-test/miko-test/most/425a073ca09f83420218ea1e4fdd3d62036bf4da/relayer/fe_bridgenet/eth_addresses.json eth/addresses.json | |
aws s3 cp s3://alephzero-devnet-contracts-test/miko-test/most/425a073ca09f83420218ea1e4fdd3d62036bf4da/relayer/fe_bridgenet/most.json azero/artifacts/most.json | |
- name: Build relayer | |
run: | | |
make build-docker-relayer DOCKER_RELAYER_NAME=most-relayer-${{ steps.get-ref-properties.outputs.sha }} | |
- name: Login to Amazon ECR | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.ECR_PRIVATE_HOST }} | |
username: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }} | |
password: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }} | |
env: | |
AWS_REGION: us-east-1 | |
- name: Push docker image to ECR | |
shell: bash | |
run: | | |
docker tag \ | |
most-relayer-${{ steps.get-ref-properties.outputs.sha }} \ | |
${{ secrets.ECR_PRIVATE_HOST }}/most-relayer:${{ steps.get-ref-properties.outputs.sha }}-bridgenet | |
docker push \ | |
${{ secrets.ECR_PRIVATE_HOST }}/most-relayer:${{ steps.get-ref-properties.outputs.sha }}-bridgenet |