mirror of
https://github.com/cnrancher/kube-explorer.git
synced 2025-04-28 03:10:32 +00:00
feat: Add release branch ci
This commit is contained in:
parent
67923822f5
commit
fb1f38e1ef
82
.github/workflows/push-release-branch.yaml
vendored
Normal file
82
.github/workflows/push-release-branch.yaml
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
name: Push to Master
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release/v*
|
||||
tags:
|
||||
- 'v*.*.*' # Matches any tag that starts with 'v' and follows semantic versioning
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Login to Aliyun ACR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: registry.cn-shenzhen.aliyuncs.com
|
||||
username: ${{ secrets.ACR_USERNAME }}
|
||||
password: ${{ secrets.ACR_TOKEN }}
|
||||
if: ${{ vars.ALIYUN == 'true' }}
|
||||
- name: Login to Dockerhub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: CI
|
||||
if: startsWith(github.ref, 'refs/heads/')
|
||||
env:
|
||||
CROSS: push
|
||||
run: make github_ci
|
||||
|
||||
- name: CI
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
CROSS: tag
|
||||
run: |
|
||||
make github_ci
|
||||
make release-note
|
||||
|
||||
- name: Prepare for packaging image
|
||||
run: cp dist/* package/
|
||||
- name: Set docker iamge name
|
||||
id: image-name
|
||||
env:
|
||||
REPO_OVERRIDE: ${{ vars.REPO || 'cnrancher' }}
|
||||
IMAGE_OVERRIDE: ${{ vars.IMAGE || 'kube-explorer' }}
|
||||
run: |
|
||||
tag_name=latest;
|
||||
if [[ ${GITHUB_REF} == refs/heads/release/* ]]; then tag_name=${GITHUB_REF#refs/heads/release/}-head; fi;
|
||||
if [[ ${GITHUB_REF} == refs/tags/* ]]; then tag_name=${GITHUB_REF#refs/tags/}; fi;
|
||||
echo "image_name=${REPO_OVERRIDE}/${IMAGE_OVERRIDE}:${tag_name}" >> $GITHUB_OUTPUT;
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Build to Dockerhub
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64/v8
|
||||
tags: "${{ steps.image-name.outputs.image_name }}"
|
||||
context: package
|
||||
push: true
|
||||
- name: Build to Aliyun
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: registry.cn-shenzhen.aliyuncs.com/${{ steps.image-name.outputs.image_name }}
|
||||
context: package
|
||||
push: true
|
||||
if: ${{ vars.ALIYUN == 'true' }}
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: dist/kube-explorer-*
|
||||
body_path: dist/release-note
|
||||
draft: true
|
Loading…
Reference in New Issue
Block a user