This commit is contained in:
parent
f0f648fb79
commit
3f3da5bd37
@ -1,11 +1,10 @@
|
||||
# 复制到 itfx 仓库 .gitea/workflows/deploy.yml
|
||||
# push master/main → prod;push test → test
|
||||
# push master → prod;push test → test
|
||||
name: Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, main, test]
|
||||
workflow_dispatch:
|
||||
branches: [master, test]
|
||||
|
||||
env:
|
||||
CSPROJ: src/InterfaceForward.Api/InterfaceForward.Api.csproj
|
||||
@ -23,16 +22,11 @@ jobs:
|
||||
run: |
|
||||
set -euxo pipefail
|
||||
REF="${{ gitea.ref_name }}"
|
||||
|
||||
if [[ "${{ gitea.event_name }}" == "workflow_dispatch" ]]; then
|
||||
TARGET="${{ inputs.target }}"
|
||||
TARGET="${TARGET:-prod}"
|
||||
else
|
||||
case "$REF" in
|
||||
test) TARGET=test ;;
|
||||
*) TARGET=prod ;;
|
||||
esac
|
||||
fi
|
||||
case "$REF" in
|
||||
test) TARGET=test ;;
|
||||
master) TARGET=prod ;;
|
||||
*) echo "unsupported branch: $REF"; exit 1 ;;
|
||||
esac
|
||||
|
||||
SHA="${{ gitea.sha }}"
|
||||
REPO="${{ gitea.repository }}"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user