Skip to content

Commit

Permalink
Swap to pushing images into quay
Browse files Browse the repository at this point in the history
This also adds multi-arch support
  • Loading branch information
jacksontj committed Feb 3, 2021
1 parent 137b1cd commit 7a6ed74
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build

on:
push:
branches:
- master
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: azure/docker-login@v1
with:
login-server: quay.io
username: '${{ secrets.QUAYIO_USERNAME }}'
password: '${{ secrets.QUAYIO_PASSWORD }}'
- name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
buildx-version: latest
qemu-version: latest
- name: Available platforms
run: 'echo ${{ steps.buildx.outputs.platforms }}'
- name: Run Buildx
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push -t quay.io/jacksontj/promxy:${GITHUB_REF##*/} .
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM golang:alpine as builder
FROM --platform=$BUILDPLATFORM golang:alpine as builder

ARG BUILDPLATFORM
ARG TARGETARCH
ARG TARGETOS
ENV GOARCH=${TARGETARCH} GOOS=${TARGETOS}

COPY . /go/src/github.com/jacksontj/promxy
RUN cd /go/src/github.com/jacksontj/promxy/cmd/promxy && CGO_ENABLED=0 go build -mod=vendor -tags netgo,builtinassets
Expand Down

0 comments on commit 7a6ed74

Please sign in to comment.