Merge pull request #3704 from lxm/feature/multiarch
[feature] use buildx to produce multi arch image #3683
This commit is contained in:
48
.github/workflows/build-multiarch.yaml
vendored
Normal file
48
.github/workflows/build-multiarch.yaml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: BuildMultiArch
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release*'
|
||||
- '*'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "Set up QEMU"
|
||||
uses: docker/setup-qemu-action@v1
|
||||
with:
|
||||
platforms: all
|
||||
|
||||
- name: "Set up Docker buildx"
|
||||
uses: "docker/setup-buildx-action@v1"
|
||||
|
||||
- name: Get branch name
|
||||
id: extract_branch
|
||||
shell: bash
|
||||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
||||
|
||||
- name: Build and push docker images
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
bash hack/docker_build_multiarch.sh ${{ steps.extract_branch.outputs.branch }}
|
||||
Reference in New Issue
Block a user