forked from zio/zio
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (90 loc) · 2.7 KB
/
site.yml
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
name: Website
env:
JDK_JAVA_OPTIONS: -Xmx6G -Xss4M -XX:+UseG1GC
JVM_OPTS: -Xmx6G -Xss4M -XX:+UseG1GC
NODE_OPTIONS: --max_old_space_size=6144
on:
workflow_dispatch:
inputs:
publish:
description: 'Publish to the Github Pages?'
required: false
default: 'false'
push:
branches:
- series/2.x
tags:
- docs.*
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout series/2.x Branch
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: '0'
path: 'series/2.x'
- name: Checkout series/1.x Branch
uses: actions/checkout@v3
with:
ref: 'series/1.x'
fetch-depth: '0'
path: 'series/1.x'
- name: Setup Scala and Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Generate Series 1.x Docs
working-directory: ./series/1.x
run: |
sbt docs/mdoc
sbt docs/unidoc
- name: Generate Series 2.x Docs
working-directory: ./series/2.x
run: |
sbt docs/mdoc
sbt docs/unidoc
- name: Move Series 1.x Docs To 2.x Docs
working-directory: ./
run: |
mkdir -p ./series/2.x/website/versioned_docs/version-1.x
mv ./series/1.x/zio-docs/target/mdoc/* ./series/2.x/website/versioned_docs/version-1.x
mkdir -p ./series/2.x/website/static/api/1.x
mv ./series/1.x/website/static/api ./series/2.x/website/static/api-1.x
- name: Install The Whole Website
working-directory: ./series/2.x/website
run: |
rm -Rf node_modules
yarn install
yarn build
- uses: actions/upload-artifact@v3
with:
name: website-artifact
path: ./series/2.x/website/build
publish:
needs: [build]
runs-on: ubuntu-20.04
steps:
- name: Checkout series/1.x Branch
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/download-artifact@v3
with:
name: website-artifact
path: website-artifact
- name: Release to GitHub Pages
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/docs.')) ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.publish)
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ./website-artifact
- name: Print All Generated Files
run: find ./website-artifact -print