Build and push signer #3
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 signer | ||
on: | ||
workflow_dispatch: | ||
outputs: | ||
docker-tag: | ||
description: Docker image tag | ||
value: ${{ jobs.build-and-push.outputs.docker-tag }} | ||
Check failure on line 8 in .github/workflows/signer-build-and-push.yml GitHub Actions / Build and push signerInvalid workflow file
|
||
jobs: | ||
check-vars-and-secrets: | ||
name: Check vars and secrets | ||
uses: ./.github/workflows/_check-vars-and-secrets.yml | ||
secrets: inherit | ||
build-and-push: | ||
needs: [check-vars-and-secrets] | ||
name: Build and push | ||
runs-on: [self-hosted, Linux, X64, large] | ||
outputs: | ||
docker-tag: ${{ steps.build.outputs.docker-tag }} | ||
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 | ||
- name: Build signer | ||
id: build | ||
run: | | ||
docker_tag=${{ steps.get-ref-properties.outputs.sha }} | ||
docker_name=most-signer-${docker_tag} | ||
make build-docker-signer \ | ||
DOCKER_SIGNER_NAME=${docker_name} | ||
echo "docker-name=${docker_name}" >> $GITHUB_OUTPUT | ||
echo "docker-tag=${docker_tag}" >> $GITHUB_OUTPUT | ||
- name: Login to Amazon ECR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ vars.ECR_PUBLIC_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_image='${{ vars.ECR_PUBLIC_REGISTRY }}most-signer:${{ steps.build.outputs.docker-tag }}' | ||
docker tag '${{ steps.build.outputs.docker-name }}' "${docker_image}" | ||
docker push "${docker_image}" |