publish to DockerHub #11
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: publish to DockerHub | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: "Tag to publish under, defaults to latest" | |
required: false | |
default: latest | |
branch: | |
description: "Branch to run publish from" | |
required: true | |
is-dry-run: | |
description: "Run in dry-run mode" | |
type: boolean | |
required: false | |
default: true | |
jobs: | |
push_to_registry: | |
environment: release | |
name: Push Docker images to Docker Hub | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- { name: "iota-gas-station", repo: "iotaledger/gas-station" } | |
- { name: "tool", repo: "iotaledger/gas-station-tool" } | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
- name: Set up QEMU (for cross-arch emulation) | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }} | |
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }} | |
- name: Build docker image (DRY-RUN) | |
if: ${{ github.event.inputs.is-dry-run == 'true' }} | |
run: | | |
chmod +x docker/build.sh | |
ENTRY_BINARY=${{ matrix.image.name }} docker/build.sh \ | |
-t ${{ matrix.image.repo }}:${{ github.event.inputs.tag }} \ | |
--platform linux/amd64,linux/arm64 \ | |
--load | |
- name: Build & Push docker image | |
if: ${{ github.event.inputs.is-dry-run != 'true' }} | |
run: | | |
chmod +x docker/build.sh | |
ENTRY_BINARY=${{ matrix.image.name }} docker/build.sh \ | |
-t ${{ matrix.image.repo }}:${{ github.event.inputs.tag }} \ | |
--platform linux/amd64,linux/arm64 \ | |
--push | |
# - name: Docker Hub Description for ${{ matrix.image.repo }} | |
# if: ${{ github.event.inputs.is-dry-run == 'false'}} | |
# uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae | |
# with: | |
# username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }} | |
# password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }} | |
# repository: ${{ matrix.image.repo }} | |
# readme-filepath: ./README.md | |
# short-description: ${{ github.event.repository.description }} |