ci: fix unexpected build and deploy behavior

This commit is contained in:
alisa
2024-04-24 10:22:18 +08:00
parent a2fcfadba2
commit bc01f3bf25
2 changed files with 6 additions and 3 deletions

View File

@@ -48,18 +48,20 @@ jobs:
run: |
if [[ "${{ github.event_name }}" != "workflow_dispatch" ]]; then
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "AZURE_TARGET_ENV=Production" >> $GITHUB_ENV
echo "AZURE_TARGET_ENV=''" >> $GITHUB_ENV
else
echo "AZURE_TARGET_ENV=dev" >> $GITHUB_ENV
fi
else
if [[ "${{ github.event.inputs.deploy-to-prod-env }}" == "true" ]]; then
echo "AZURE_TARGET_ENV=Production" >> $GITHUB_ENV
echo "AZURE_TARGET_ENV=''" >> $GITHUB_ENV
else
echo "AZURE_TARGET_ENV=dev" >> $GITHUB_ENV
fi
fi
echo "Deployment environment: ${{ env.AZURE_TARGET_ENV }}"
- name: Show environment
run: echo ${{ env.AZURE_TARGET_ENV }}
- name: Deploy to Azure
id: deploy

View File

@@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- "master"
- "dev"
paths:
- "docs/**"
- "website/**"