-
Notifications
You must be signed in to change notification settings - Fork 11
97 lines (82 loc) · 2.87 KB
/
deploy.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
name: Deploy webpage
# We combine both `main` and `upcoming` into a single webpage
on:
push:
branches:
- 'main'
- 'upcoming'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/configure-pages@v3
id: setup-pages
- name: Checkout main
uses: actions/checkout@v3
with:
ref: main
path: main
- name: Checkout upcoming
uses: actions/checkout@v3
with:
ref: upcoming
path: upcoming
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20.8'
cache: yarn
cache-dependency-path: |
main/website/yarn.lock
upcoming/website/yarn.lock
- name: Install dependencies (main)
working-directory: main/website
run: yarn install --frozen-lockfile
- name: Download language docs
working-directory: main/website
run: yarn ts-node download_links.ts docs_py docs_cxx docs_java
- name: Build webpage for `main` branch
working-directory: main/website
run: yarn build
env:
GITHUB_ORIGIN: ${{ steps.setup-pages.outputs.origin }}
GITHUB_BASE_PATH: ${{ steps.setup-pages.outputs.base_path }}
- name: Install dependencies (upcoming)
working-directory: upcoming/website
run: yarn install --frozen-lockfile
- name: Build webpage for `upcoming` branch
working-directory: upcoming/website
run: yarn build
env:
GITHUB_ORIGIN: ${{ steps.setup-pages.outputs.origin }}
GITHUB_BASE_PATH: ${{ steps.setup-pages.outputs.base_path }}/upcoming
IS_UPCOMING: '1'
- name: Combine `main`, `upcoming` and language docs
run: |
mv main/website/build combined
mv upcoming/website/build combined/upcoming
mkdir combined/lang_docs
unzip main/website/docs_py.zip -d combined/lang_docs
mv combined/lang_docs/tableauhyperapi-py-docs-* combined/lang_docs/py
unzip main/website/docs_cxx.zip -d combined/lang_docs
mv combined/lang_docs/tableauhyperapi-cxx-docs-* combined/lang_docs/cxx
unzip main/website/docs_java.zip -d combined/lang_docs
mv combined/lang_docs/tableauhyperapi-java-docs-* combined/lang_docs/java
- name: Upload webpage artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'combined'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2