Build multi-arch images #40
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 Docker Image | |
on: | |
create: | |
jobs: | |
build: | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
name: "Build" | |
runs-on: "ubuntu-latest" | |
env: | |
DOCKER_REPOSITORY: "starknet/pathfinder-firehose" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v2" | |
- name: "Login to Docker Hub" | |
uses: "docker/[email protected]" | |
with: | |
username: "${{ secrets.DOCKER_HUB_USERNAME }}" | |
password: "${{ secrets.DOCKER_HUB_PASSWORD }}" | |
- name: "Determine image version" | |
run: | | |
version_line="${{ github.ref }}" | |
regex="^refs\/tags\/v(.*)$" | |
[[ $version_line =~ $regex ]]; | |
echo "VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV | |
- name: "Build Docker image" | |
run: | | |
docker buildx build \ | |
--build-arg PATHFINDER_FORCE_VERSION="v${VERSION}" \ | |
-t ${DOCKER_REPOSITORY}:${VERSION} -f ./Dockerfile . | |
- name: "Push Docker image" | |
run: | | |
docker push ${DOCKER_REPOSITORY}:${VERSION} |