forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (92 loc) · 3.77 KB
/
scaladoc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: scaladoc
on:
push:
pull_request:
jobs:
build:
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
runs-on: ubuntu-latest
if: "( github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip docs]')
)
|| contains(github.event.ref, 'scaladoc')
|| contains(github.event.ref, 'master')"
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Cache Coursier
uses: actions/cache@v1
with:
path: ~/.cache/coursier
key: sbt-coursier-cache
- name: Cache SBT
uses: actions/cache@v1
with:
path: ~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Compile and test scala3doc-js
run: ./project/scripts/sbt scaladoc-js/test
- name: Compile and test
run: ./project/scripts/sbt scaladoc/test
- name: Locally publish self
run: ./project/scripts/sbt scaladoc/publishLocal
- name: Generate self documentation
run: ./project/scripts/sbt scaladoc/generateSelfDocumentation
- name: Generate testcases documentation
run: ./project/scripts/sbt scaladoc/generateTestcasesDocumentation
- name: Generate Scala 3 documentation
run: ./project/scripts/sbt scaladoc/generateScalaDocumentation
- name: Generate documentation for example project using dotty-sbt
run: ./project/scripts/sbt "sbt-dotty/scripted sbt-dotty/scaladoc"
- name: Generate index file
run: scaladoc/scripts/mk-index.sh scaladoc/output > scaladoc/output/index.html
- name: Upload documentation to server
uses: azure/CLI@v1
if: env.AZURE_STORAGE_SAS_TOKEN
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
with:
inlineScript: |
DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}}
echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
az storage blob upload-batch -s scaladoc/output -d $DOC_DEST --account-name scala3docstorage
community-docs:
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
runs-on: ubuntu-latest
if: "( github.event_name == 'pull_request'
&& !contains(github.event.pull_request.body, '[skip ci]')
&& !contains(github.event.pull_request.body, '[skip docs]')
)
|| contains(github.event.ref, 'scaladoc')
|| contains(github.event.ref, 'scala3doc')
|| contains(github.event.ref, 'master')"
steps:
- name: Git Checkout
uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Init submodules
run: git submodule update --init --recursive --jobs 7
- name: Generate docs
run: ./project/scripts/sbt "community-build/run doc all docsOutput"
- name: Upload documentation to server
uses: azure/CLI@v1
if: env.AZURE_STORAGE_SAS_TOKEN
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
with:
inlineScript: |
DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}}-docs
echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
az storage blob upload-batch -s community-build/docsOutput -d $DOC_DEST --account-name scala3docstorage