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