mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
ci: fix deploy failed when get empty pr id (#50001)
This commit is contained in:
parent
21946036a0
commit
29490fac64
12
.github/workflows/preview-deploy.yml
vendored
12
.github/workflows/preview-deploy.yml
vendored
@ -70,7 +70,13 @@ jobs:
|
||||
# Save PR id to output
|
||||
- name: save PR id
|
||||
id: pr
|
||||
run: echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
|
||||
run: |
|
||||
pr_id=$(<pr-id.txt)
|
||||
if ! [[ "$pr_id" =~ ^[0-9]+$ ]]; then
|
||||
echo "Error: pr-id.txt does not contain a valid numeric PR id. Please check."
|
||||
exit 1
|
||||
fi
|
||||
echo "id=$pr_id" >> $GITHUB_OUTPUT
|
||||
|
||||
# Download site artifact
|
||||
- name: download site artifact
|
||||
@ -84,8 +90,10 @@ jobs:
|
||||
- name: upload surge service
|
||||
id: deploy
|
||||
continue-on-error: true
|
||||
env:
|
||||
PR_ID: ${{ steps.pr.outputs.id }}
|
||||
run: |
|
||||
export DEPLOY_DOMAIN=https://preview-${{ steps.pr.outputs.id }}-ant-design.surge.sh
|
||||
export DEPLOY_DOMAIN=https://preview-${PR_ID}-ant-design.surge.sh
|
||||
npx surge --project ./ --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }}
|
||||
|
||||
- name: success comment
|
||||
|
Loading…
Reference in New Issue
Block a user