Build and Publish Ledger App Builder Image #33
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 Publish Ledger App Builder Image" | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- "ledger-app-builder/*" | |
- ".github/workflows/publishLedger.yml" | |
jobs: | |
publish_ledger: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Git commit hash | |
id: hash | |
run: | | |
echo "ledgerHash=$(git ls-remote https://github.com/LedgerHQ/ledger-app-builder | head -n 1 | awk '{print $1}')" >> $GITHUB_OUTPUT | |
echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Set up QEMU # to build multitarget containers | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ledger-app-builder | |
platforms: linux/amd64,linux/arm64 | |
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch' }} | |
tags: >- | |
zondax/ledger-app-builder:${{ steps.hash.outputs.hash }}, | |
zondax/ledger-app-builder:latest, | |
zondax/ledger-app-builder:ledger-${{ steps.hash.outputs.ledgerHash }} |