mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-21 21:46:56 +00:00
Signed-off-by: basefas <basefas@hotmail.com> Signed-off-by: basefas <basefas@hotmail.com>
188 lines
7.5 KiB
YAML
188 lines
7.5 KiB
YAML
name: Registry
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch: {}
|
|
|
|
env:
|
|
ACCESS_KEY: ${{ secrets.OSS_ACCESS_KEY }}
|
|
ACCESS_KEY_SECRET: ${{ secrets.OSS_ACCESS_KEY_SECRET }}
|
|
|
|
jobs:
|
|
publish-core-images:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Get the version
|
|
id: get_version
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
|
|
VERSION=latest
|
|
fi
|
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
|
- name: Get git revision
|
|
id: vars
|
|
shell: bash
|
|
run: |
|
|
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
- name: Login ghcr.io
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Login docker.io
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: docker.io
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Login Alibaba Cloud ACR
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ secrets.ACR_DOMAIN }}
|
|
username: ${{ secrets.ACR_USERNAME }}
|
|
password: ${{ secrets.ACR_PASSWORD }}
|
|
- uses: docker/setup-qemu-action@v2
|
|
- uses: docker/setup-buildx-action@v2
|
|
with:
|
|
driver-opts: image=moby/buildkit:master
|
|
|
|
- uses: docker/build-push-action@v3
|
|
name: Build & Pushing vela-core for Dockerhub, GHCR and ACR
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
labels: |-
|
|
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
build-args: |
|
|
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
|
|
VERSION=${{ steps.get_version.outputs.VERSION }}
|
|
GOPROXY=https://proxy.golang.org
|
|
tags: |-
|
|
docker.io/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
|
|
ghcr.io/${{ github.repository_owner }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
|
|
${{ secrets.ACR_DOMAIN }}/oamdev/vela-core:${{ steps.get_version.outputs.VERSION }}
|
|
|
|
- uses: docker/build-push-action@v3
|
|
name: Build & Pushing CLI for Dockerhub, GHCR and ACR
|
|
with:
|
|
context: .
|
|
file: Dockerfile.cli
|
|
labels: |-
|
|
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
build-args: |
|
|
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
|
|
VERSION=${{ steps.get_version.outputs.VERSION }}
|
|
GOPROXY=https://proxy.golang.org
|
|
tags: |-
|
|
docker.io/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
|
|
ghcr.io/${{ github.repository_owner }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
|
|
${{ secrets.ACR_DOMAIN }}/oamdev/vela-cli:${{ steps.get_version.outputs.VERSION }}
|
|
|
|
publish-addon-images:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Get the version
|
|
id: get_version
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/}
|
|
if [[ ${GITHUB_REF} == "refs/heads/master" ]]; then
|
|
VERSION=latest
|
|
fi
|
|
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
|
|
- name: Get git revision
|
|
id: vars
|
|
shell: bash
|
|
run: |
|
|
echo "git_revision=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
- name: Login ghcr.io
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Login docker.io
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: docker.io
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Login Alibaba Cloud ACR
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ secrets.ACR_DOMAIN }}
|
|
username: ${{ secrets.ACR_USERNAME }}
|
|
password: ${{ secrets.ACR_PASSWORD }}
|
|
- uses: docker/setup-qemu-action@v2
|
|
- uses: docker/setup-buildx-action@v2
|
|
with:
|
|
driver-opts: image=moby/buildkit:master
|
|
|
|
- uses: docker/build-push-action@v3
|
|
name: Build & Pushing vela-apiserver for Dockerhub, GHCR and ACR
|
|
with:
|
|
context: .
|
|
file: Dockerfile.apiserver
|
|
labels: |-
|
|
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
build-args: |
|
|
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
|
|
VERSION=${{ steps.get_version.outputs.VERSION }}
|
|
GOPROXY=https://proxy.golang.org
|
|
tags: |-
|
|
docker.io/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
|
|
ghcr.io/${{ github.repository_owner }}/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
|
|
${{ secrets.ACR_DOMAIN }}/oamdev/vela-apiserver:${{ steps.get_version.outputs.VERSION }}
|
|
|
|
- uses: docker/build-push-action@v3
|
|
name: Build & Pushing runtime rollout Dockerhub, GHCR and ACR
|
|
with:
|
|
context: .
|
|
file: runtime/rollout/Dockerfile
|
|
labels: |-
|
|
org.opencontainers.image.source=https://github.com/${{ github.repository }}
|
|
org.opencontainers.image.revision=${{ github.sha }}
|
|
platforms: linux/amd64,linux/arm64
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
build-args: |
|
|
GITVERSION=git-${{ steps.vars.outputs.git_revision }}
|
|
VERSION=${{ steps.get_version.outputs.VERSION }}
|
|
GOPROXY=https://proxy.golang.org
|
|
tags: |-
|
|
docker.io/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
|
|
ghcr.io/${{ github.repository_owner }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
|
|
${{ secrets.ACR_DOMAIN }}/oamdev/vela-rollout:${{ steps.get_version.outputs.VERSION }}
|
|
|
|
publish-capabilities:
|
|
env:
|
|
CAPABILITY_BUCKET: kubevela-registry
|
|
CAPABILITY_DIR: capabilities
|
|
CAPABILITY_ENDPOINT: oss-cn-beijing.aliyuncs.com
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install ossutil
|
|
run: wget http://gosspublic.alicdn.com/ossutil/1.7.0/ossutil64 && chmod +x ossutil64 && mv ossutil64 ossutil
|
|
- name: Configure Alibaba Cloud OSSUTIL
|
|
run: ./ossutil --config-file .ossutilconfig config -i ${ACCESS_KEY} -k ${ACCESS_KEY_SECRET} -e ${CAPABILITY_ENDPOINT} -c .ossutilconfig
|
|
- name: sync capabilities bucket to local
|
|
run: ./ossutil --config-file .ossutilconfig sync oss://$CAPABILITY_BUCKET $CAPABILITY_DIR
|
|
- name: rsync all capabilites
|
|
run: rsync vela-templates/registry/auto-gen/* $CAPABILITY_DIR
|
|
- name: sync local to cloud
|
|
run: ./ossutil --config-file .ossutilconfig sync $CAPABILITY_DIR oss://$CAPABILITY_BUCKET -f |