Skip to content

Commit a00877d

Browse files
authored
Merge pull request #14852 from dotty-staging/scaladoc/language-reference-workflow
Workflow to generate and push language reference documentation
2 parents 73df472 + 3a075bb commit a00877d

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: language-reference-documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- 'language-reference-stable'
7+
pull_request:
8+
branches:
9+
- 'language-reference-stable'
10+
workflow_dispatch
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Get current date
17+
id: date
18+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
19+
20+
- name: Git Checkout
21+
uses: actions/checkout@v3
22+
with:
23+
path: 'dotty'
24+
ref: 'language-reference-stable'
25+
ssh-key: ${{ secrets.DOCS_KEY }}
26+
27+
- name: Cache Coursier
28+
uses: actions/cache@v1
29+
with:
30+
path: ~/.cache/coursier
31+
key: sbt-coursier-cache
32+
33+
- name: Cache SBT
34+
uses: actions/cache@v1
35+
with:
36+
path: ~/.sbt
37+
key: sbt-${{ hashFiles('**/build.sbt') }}
38+
39+
- name: Set up JDK 11
40+
uses: actions/setup-java@v1
41+
with:
42+
java-version: 11
43+
44+
- name: Generate reference documentation and test links
45+
run: |
46+
./dotty/project/scripts/sbt scaladoc/generateReferenceDocumentation --no-regenerate-expected-links
47+
./dotty/project/scripts/docsLinksStability ./dotty/scaladoc/output/reference ./dotty/project/scripts/expected-links/reference-expected-links.txt
48+
49+
- name: Push changes to scala3-reference-docs
50+
if: github.event_name == 'push'
51+
uses: actions/checkout@v3
52+
with:
53+
repository: lampepfl/scala3-reference-docs
54+
fetch-depth: 0
55+
submodules: true
56+
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}
57+
path: 'scala3-reference-docs'
58+
59+
- if: github.event_name == 'push'
60+
run: |
61+
\cp -a dotty/scaladoc/output/reference/. scala3-reference-docs/
62+
cd scala3-reference-docs
63+
git config user.name gh-actions
64+
git config user.email [email protected]
65+
git add .
66+
git commit -m "UPDATE ${{ steps.date.outputs.date }}"
67+
git push
68+
cd ..
69+
70+
- name: Merge changes to main
71+
if: github.event_name == 'push'
72+
run: |
73+
cd dotty
74+
git fetch origin main:main
75+
git checkout main
76+
git merge language-reference-stable
77+
cd ..
78+
79+
- name: Create pull reuqest with backport to main
80+
if: github.event_name == 'push'
81+
uses: peter-evans/create-pull-request@v4
82+
with:
83+
path: dotty
84+
branch: language-reference-backport
85+
labels: area:documentation
86+

0 commit comments

Comments
 (0)