Skip to content

Commit

Permalink
fix arm builds. only build arm for tags and merges to default branch. (
Browse files Browse the repository at this point in the history
…#12)

* fix arm builds. only build arm for tags and merges to default branch.

* fix gh action function syntax

* more correct comment

* build for semver tags
  • Loading branch information
steezeburger authored Apr 17, 2023
1 parent 85e0262 commit e19690c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/astria-build-and-publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checking out the repo
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Setting up Go
- uses: actions/setup-go@v4
with:
Expand All @@ -30,13 +30,17 @@ jobs:

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Generate correct tabs and labels
- name: Docker metadata
id: metadata
Expand All @@ -54,8 +58,8 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
# It takes over 30 minutes to build the arm image right now, so we only build it on tags which is what we use for releases.
platforms: ${{ contains(github.ref, 'refs/tags/v') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
# It takes a long time to build the arm image right now, so we only build it on tags which is what we use for releases, or on merges to the default branch.
platforms: ${{ (contains(github.ref, 'refs/tags/v') || github.ref == join('refs/heads/', github.event.repository.default_branch)) && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as builder
FROM golang:1.20-alpine as builder

RUN apk add --no-cache gcc musl-dev linux-headers git

Expand All @@ -17,7 +17,7 @@ ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth

# Pull Geth into a second stage deploy alpine container
FROM --platform=$BUILDPLATFORM alpine:latest
FROM alpine:latest

RUN apk add --no-cache ca-certificates
# Astria - add bash and jq to support start-geth.sh in conductor
Expand Down

0 comments on commit e19690c

Please sign in to comment.