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
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - master
7
- pull_request_target :
5
+ pull_request :
8
6
jobs :
9
7
build :
8
+ env :
9
+ AZURE_STORAGE_SAS_TOKEN : ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
10
10
runs-on : ubuntu-latest
11
+ if : " github.event_name == 'pull_request' || contains(github.event.ref, 'scala3doc') || contains(github.event.ref, 'master')"
11
12
12
13
steps :
13
14
- name : Git Checkout
14
15
uses : actions/checkout@v2
15
16
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
-
29
17
- name : Cache Coursier
30
18
uses : actions/cache@v1
31
19
with :
@@ -68,12 +56,12 @@ jobs:
68
56
69
57
- name : Upload documentation to server
70
58
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 :
73
61
PR_NUMBER : ${{ github.event.pull_request.number }}
74
62
with :
75
63
inlineScript : |
76
- DOC_DEST=pr-${PR_NUMBER:-master }
64
+ DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/} }
77
65
echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
78
66
az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
79
67
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