Skip to content

Commit

Permalink
ci: fix pr number
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Feb 2, 2024
1 parent fc00107 commit 3e7444e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number ?? steps.findPr.outputs.pr }}
- uses: actions/cache@v3
with:
path: ./node_modules
Expand All @@ -35,7 +35,7 @@ jobs:
run: yarn run site:build
- name: 'Deploy Site'
run: |
export DEPLOY_DOMAIN=https://preview-${{ steps.findPr.outputs.pr }}-ng-alain-delon.surge.sh
export DEPLOY_DOMAIN=https://preview-${{ github.event.number ?? steps.findPr.outputs.pr }}-ng-alain-delon.surge.sh
echo "Deploy to $DEPLOY_DOMAIN"
cp ./src/dist/browser/index.html ./src/dist/browser/404.html
npx surge --project ./src/dist/browser --domain $DEPLOY_DOMAIN
Expand All @@ -46,19 +46,19 @@ jobs:
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
- name: 'Update comment on github'
run: |
export DEPLOY_DOMAIN=https://preview-${{ steps.findPr.outputs.pr }}-ng-alain-delon.surge.sh
export DEPLOY_DOMAIN=https://preview-${{ github.event.number ?? steps.findPr.outputs.pr }}-ng-alain-delon.surge.sh
node ./scripts/github/comment.js "[Preview is ready!]($DEPLOY_DOMAIN)"
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number ?? steps.findPr.outputs.pr }}
- name: 'When failed'
if: failure()
run: node ./scripts/github/comment.js "[Preview Build Failed!](https://github.com/ng-alain/delon/actions/runs/${{ github.run_id }})"
env:
ACCESS_REPO: ${{ github.repository }}
ACCESS_TOKEN: ${{ secrets.CI_TOKEN }}
PR_NUMBER: ${{ steps.findPr.outputs.pr }}
PR_NUMBER: ${{ github.event.number ?? steps.findPr.outputs.pr }}

test:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 3e7444e

Please sign in to comment.