feat: add release branch, update and merge release workflow
All checks were successful
test-build / guarddog (push) Successful in 50s
renovate / renovate (push) Successful in 58s
test-build / build (push) Successful in 4m4s

This commit is contained in:
2026-03-12 13:54:11 -05:00
parent 07fa86b17c
commit 68f2080bda
3 changed files with 408 additions and 38 deletions

View File

@@ -1,18 +1,42 @@
name: release-image-harbor
on:
push:
tags:
- 3.*
workflow_dispatch:
jobs:
semantic-release:
runs-on: ubuntu-js
outputs:
new_release_published: ${{ steps.semantic.outputs.new_release_published }}
new_release_version: ${{ steps.semantic.outputs.new_release_version }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.10
- name: Run Semantic Release
id: semantic
env:
GITEA_TOKEN: ${{ secrets.BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
bunx semantic-release
build:
needs: semantic-release
if: ${{ needs.semantic-release.outputs.new_release_published == 'true' }}
runs-on: ubuntu-js
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: release
- name: Set up Bun
uses: oven-sh/setup-bun@v2
@@ -59,10 +83,14 @@ jobs:
image: true
guarddog:
needs: semantic-release
if: ${{ needs.semantic-release.outputs.new_release_published == 'true' }}
runs-on: ubuntu-js
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: release
- name: Set up Python
uses: actions/setup-python@v6
@@ -95,10 +123,13 @@ jobs:
release:
runs-on: ubuntu-js
needs: [build, guarddog]
needs: [build, guarddog, semantic-release]
if: ${{ needs.semantic-release.outputs.new_release_published == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: release
- name: Login to Harbor Registry
uses: docker/login-action@v4
@@ -148,17 +179,6 @@ jobs:
images: |
${{ vars.REGISTRY_HOST }}/images/site-profile
- name: Get Version Info
id: version
run: |
echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
if git describe --tags --exact-match HEAD 2>/dev/null; then
echo "is_release=true" >> $GITHUB_OUTPUT
else
echo "is_release=false" >> $GITHUB_OUTPUT
fi
- name: Build and Push Image
uses: docker/build-push-action@v7
with:
@@ -168,9 +188,9 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
APP_VERSION=${{ steps.version.outputs.version }}
COMMIT_SHA=${{ steps.version.outputs.commit }}
IS_RELEASE=${{ steps.version.outputs.is_release }}
APP_VERSION=${{ needs.semantic-release.outputs.new_release_version }}
COMMIT_SHA=${{ github.sha }}
IS_RELEASE=true
file: ./Dockerfile
cache-from: type=gha
cache-to: type=gha,mode=max