Fix multi-platform images (#514)

This commit is contained in:
Hidetake Iwata
2021-03-22 12:10:22 +09:00
committed by GitHub
parent 037d26b01f
commit 74c9404e69
4 changed files with 58 additions and 19 deletions

35
.github/workflows/docker.yaml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: docker
on:
push:
branches:
- master
paths:
- .github/workflows/docker.yaml
- pkg/**
- go.*
- Dockerfile
tags:
- v*
pull_request:
branches:
- master
paths:
- .github/workflows/docker.yaml
- pkg/**
- go.*
- Dockerfile
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- run: make docker-build-push

View File

@@ -84,20 +84,6 @@ jobs:
restore-keys: |
go-${{ matrix.platform.GOOS }}-${{ matrix.platform.GOARCH }}-
- run: make dist
# Docker image (Linux only)
- uses: docker/setup-buildx-action@v1
if: runner.os == 'Linux'
- uses: docker/login-action@v1
if: runner.os == 'Linux'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- run: make docker-build-push
if: runner.os == 'Linux'
# GitHub Releases
- run: make dist-release
if: startswith(github.ref, 'refs/tags/')
env: