Skip to content

Build multi-arch images #40

Build multi-arch images

Build multi-arch images #40

Workflow file for this run

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}