kyuubi/.github/workflows/publish-snapshot-docker.yml
phyyou da000c6054
[KYUUBI #4576] Multi arch build for ARM support in Docker Hub
Close #4576

* Setup QEMU and Buildx.
* Use action docker/build-push-actionv4.
* build multi platform (amd64, arm64)
* build cache for faster build 

### _Why are the changes needed?_

Based on This [Disscussion](https://github.com/apache/kyuubi/discussions/4487) and [Issue](https://github.com/apache/kyuubi/issues/4576)

Update publish-snapshot-docker workflow

### _How was this patch tested?_
now test in progress...

![image](https://user-images.githubusercontent.com/34825352/226776684-4d57dd0e-141a-44a0-a023-8eb43b57bdba.png)

https://github.com/phyyou/_kyuubi/actions/runs/4485366649/jobs/7886838765

- [x] Add screenshots for manual tests if appropriate

- [x] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4577 from phyyou/feat/buildx-at-docker-hub-snapshot.

Closes #4576

b75b05e9d [phyyou] chore(build): Chore on workflow yml
11353e7df [phyyou] build: Update publish snapshot docker workflow

Authored-by: phyyou <gydudwls@gmail.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
2023-03-22 16:31:31 +08:00

52 lines
1.8 KiB
YAML

#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Publish Snapshot Docker Image
on:
schedule:
- cron: '0 0 * * *'
jobs:
push_to_registry:
name: Push Snapshot Docker Image to Docker Hub
if: ${{ startsWith(github.repository, 'apache/') }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Kyuubi Docker Image
uses: docker/build-push-action@v4
with:
# build cache on Github Actions, See: https://docs.docker.com/build/cache/backends/gha/#using-dockerbuild-push-action
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: build/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: apache/kyuubi:master-snapshot