feat: add Dockerfiles and workflow configurations for CRUD, Ingest, and Web APIs
release-web / release (push) Has been cancelled

This commit is contained in:
marco.chan committed 2026-09-04 12:38:53 +08:00
1 parent d3b6c5032f
commit d8b7b9735b
7 files changed
+334

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
name: release-web
on:
push:
tags:
- 'web/v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from tag
id: meta
shell: bash
run: |
set -euo pipefail
TAG="${GITHUB_REF_NAME}"
VERSION="${TAG#web/v}"
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
- name: Build Docker image (root context)
shell: bash
run: |
set -euo pipefail
docker build \
--file apps/web/Dockerfile \
--tag web:${{ steps.meta.outputs.version }} \
.
- name: Package tar + filtered env
id: bundle
shell: bash
run: |
set -euo pipefail
VERSION="${{ steps.meta.outputs.version }}"
OUT_DIR="dist/release"
TAR_PATH="${OUT_DIR}/web-${VERSION}.tar"
ZIP_PATH="${OUT_DIR}/web-${VERSION}.zip"
ENV_PATH="${OUT_DIR}/.env"
mkdir -p "${OUT_DIR}"
docker save --output "${TAR_PATH}" "web:${VERSION}"
if [ ! -f .env.production ]; then
echo ".env.production is missing at repository root" >&2
exit 1
fi
# Keep only variables needed by web deployment.
grep -E '^(NODE_ENV|VITE_)=' .env.production > "${ENV_PATH}"
zip -j "${ZIP_PATH}" "${TAR_PATH}" "${ENV_PATH}"
echo "zip_path=${ZIP_PATH}" >> "${GITHUB_OUTPUT}"
- name: Create Gitea release with artifact
uses: https://gitea.com/actions/gitea-release-action@v1
with:
token: ${{ secrets.RELEASE_TOKEN }}
tag_name: ${{ github.ref_name }}
name: web v${{ steps.meta.outputs.version }}
body: |
Automated release bundle for web.
Includes:
- Docker image tar
- filtered .env for deploy
files: |
${{ steps.bundle.outputs.zip_path }}