File tree Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Expand file tree Collapse file tree 1 file changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -2,30 +2,18 @@ name: CI for Scala3doc
22
33on :
44 push :
5- branches :
6- - master
7- pull_request_target :
5+ pull_request :
86jobs :
97 build :
8+ env :
9+ AZURE_STORAGE_SAS_TOKEN : ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
1010 runs-on : ubuntu-latest
11+ if : " github.event_name == 'pull_request' || contains(github.event.ref, 'scala3doc') || contains(github.event.ref, 'master')"
1112
1213 steps :
1314 - name : Git Checkout
1415 uses : actions/checkout@v2
1516
16- - name : Checkout to PR code
17- env :
18- PR_NUMBER : ${{ github.event.pull_request.number }}
19- run : |
20- if [[ -z "${PR_NUMBER}" ]]; then
21- echo Not a pull request do not need to checkout
22- else
23- REF=refs/pull/$PR_NUMBER/merge
24- echo checking $REF
25- git fetch origin $REF:$REF
26- git checkout $REF
27- fi
28-
2917 - name : Cache Coursier
3018 uses : actions/cache@v1
3119 with :
@@ -68,12 +56,12 @@ jobs:
6856
6957 - name : Upload documentation to server
7058 uses : azure/CLI@v1
71- env :
72- AZURE_STORAGE_SAS_TOKEN : ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
59+ if : env.AZURE_STORAGE_SAS_TOKEN
60+ env :
7361 PR_NUMBER : ${{ github.event.pull_request.number }}
7462 with :
7563 inlineScript : |
76- DOC_DEST=pr-${PR_NUMBER:-master }
64+ DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/} }
7765 echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
7866 az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
7967 az storage blob sync -s scala3doc/output -c $DOC_DEST --account-name scala3docstorage
You can’t perform that action at this time.
0 commit comments