mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-05 03:21:13 +00:00
5d4fe8efb9
There is a mix of v2, v3 and v4 in the codebase. Let's move to v4 everywhere because v2 seems to be using a deprecated version of nodejs. This is throwing warnings when the Github action CI is running. Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: Cloud Hypervisor's Docker image update
|
|
|
|
on:
|
|
push:
|
|
branches: main
|
|
paths: resources/Dockerfile
|
|
pull_request:
|
|
paths: resources/Dockerfile
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
main:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Code checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to ghcr
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
# generate Docker tags based on the following events/attributes
|
|
tags: |
|
|
type=raw,value={{date 'YYYYMMDD'}}-0
|
|
type=sha
|
|
|
|
- name: Build and push
|
|
if: ${{ github.event_name == 'push' }}
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
file: ./resources/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
- name: Build only
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
file: ./resources/Dockerfile
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }}
|