Skip to content

update workflow

update workflow #35

Workflow file for this run

name: Image Build
on:
workflow_dispatch:
push:
branches:
- '**'
tags:
- 'v*.*.*'
jobs:
Build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Docker meta for KubeSphere
id: meta
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/s2irun
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Build env
id: build_env
run: |
if [ ${{ github.ref_type }} == "tag" ]
then
echo "::set-output name=platforms::linux/amd64,linux/arm64"
else
echo "::set-output name=platforms::linux/amd64"
fi
echo "::set-output name=push::true"
echo "::set-output name=load::false"
echo "::set-output name=short_sha::${GITHUB_SHA::7}"
- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ steps.build_env.outputs.push }}
load: ${{ steps.build_env.outputs.load }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ steps.build_env.outputs.platforms }}