File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -11,23 +11,31 @@ jobs:
1111 build :
1212 name : cleanup
1313 runs-on : ubuntu-latest
14+ env :
15+ PULL_FOLDER : pull_${{ github.event.pull_request.number }}
1416 steps :
1517 # checkout at gh-pages branch
1618 - uses : actions/checkout@v2
1719 with :
1820 ref : gh-pages
1921
22+ # check if folder for this pull request exists
23+ - name : Check folder existence
24+ id : check_files
25+ uses : andstor/file-existence-action@v1
26+ with :
27+ files : ${{ env.PULL_FOLDER }}
28+
2029 # delete the corresponding pull request doc folder
2130 - name : Delete folder
22- env :
23- PULL_FOLDER : pull_${{ github.event.pull_request.number }}
31+ if : steps.check_files.outputs.files_exists == 'true'
2432 run : |
2533 echo the folder $PULL_FOLDER will be deleted
2634 if [ -d "$PULL_FOLDER" ]; then rm -Rf $PULL_FOLDER; fi
2735
2836 # force push the deletion to gp-pages
2937 - name : Deploy docs
30- if : success()
38+ if : success() && steps.check_files.outputs.files_exists == 'true'
3139 uses : crazy-max/ghaction-github-pages@v2
3240 with :
3341 target_branch : gh-pages
Original file line number Diff line number Diff line change 1212 build :
1313 name : build and deploy docs
1414 runs-on : ubuntu-latest
15+ env :
16+ GH_PAT : ${{secrets.GH_PAT}}
1517 steps :
1618 - uses : actions/checkout@v2
1719 - name : Set up Python 3.8
4446 echo "Docs will be deployed to https://compas.dev/compas/$BRANCH_OR_TAG"
4547 mkdir -p deploy/$BRANCH_OR_TAG && mv -T dist/docs deploy/$BRANCH_OR_TAG/
4648 - name : Deploy docs
47- if : success()
49+ if : success() && env.GH_PAT != ''
4850 uses : crazy-max/ghaction-github-pages@v2
4951 with :
5052 target_branch : gh-pages
You can’t perform that action at this time.
0 commit comments