Skip to content

Commit e8da5c8

Browse files
authored
Merge pull request #10276 from romanowski/scala3doc/upload-doc-after-ci
CI generated docs on scala3doc.virtuslab.com
2 parents c1e41ed + 7167640 commit e8da5c8

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

.github/workflows/scala3doc.yaml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,28 @@ on:
44
push:
55
branches:
66
- master
7-
pull_request:
7+
pull_request_target:
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
11-
container: lampepfl/dotty:2020-04-24
1211

1312
steps:
1413
- name: Git Checkout
1514
uses: actions/checkout@v2
1615

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+
1729
- name: Cache Coursier
1830
uses: actions/cache@v1
1931
with:
@@ -44,3 +56,15 @@ jobs:
4456

4557
- name: Generate documentation for example project using dotty-sbt
4658
run: ./project/scripts/sbt "sbt-dotty/scripted sbt-dotty/scala3doc"
59+
60+
- name: Upload documentation to server
61+
uses: azure/CLI@v1
62+
env:
63+
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}
64+
PR_NUMBER: ${{ github.event.pull_request.number }}
65+
with:
66+
inlineScript: |
67+
DOC_DEST=pr-$PR_NUMBER
68+
echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
69+
az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
70+
az storage blob sync -s scala3doc/output -c $DOC_DEST --account-name scala3docstorage

scala3doc/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,18 @@ work on the project.
6060
For every PR, we build documentation for Scala3doc and Dotty. For example, for
6161
PR 123 you can find them at:
6262

63-
- <https://scala3doc.s3.eu-central-1.amazonaws.com/pr-123/self/main/index.html>
64-
- <https://scala3doc.s3.eu-central-1.amazonaws.com/pr-123/stdLib/main/index.html>
63+
- <https://scala3doc.virtuslab.com/pr-123/self/main/index.html>
64+
- <https://scala3doc.virtuslab.com/pr-123/scala3/main/index.html>
65+
- <https://scala3doc.virtuslab.com/pr-123/testcases/main/index.html>
6566

6667
Note that these correspond to the contents of `output` directory - that's
6768
precisely what they are.
6869

6970
You can also find the result of building the same sites for latest `master` at:
7071

71-
- <https://scala3doc.s3.eu-central-1.amazonaws.com/pr-master/self/main/index.html>
72-
- <https://scala3doc.s3.eu-central-1.amazonaws.com/pr-master/stdLib/main/index.html>
72+
- <https://scala3doc.virtuslab.com/master/self/main/index.html>
73+
- <https://scala3doc.virtuslab.com/master/scala3/main/index.html>
74+
- <https://scala3doc.virtuslab.com/master/testcases/main/index.html>
7375

7476
### Testing
7577

0 commit comments

Comments
 (0)