-
Notifications
You must be signed in to change notification settings - Fork 179
70 lines (64 loc) · 2.19 KB
/
docs-build.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
# This workflow builds API docs when either:
#
# * A commit is tagged like "docs@foo".
#
# * Someone pushes, to any branch, a commit that touches any of:
# * The parts of the api/ project that are used by the docs.
# * The docs source themselves;
# * The CI/makefile tooling used to build the docs.
name: 'API docs build'
on:
push:
tags:
- 'docs@*'
branches:
# We don't want to do any filtering based on branch name.
# But because we specified `tags`, we need to specify `branches` too,
# or else GitHub will only run this workflow for tag matches
# and not for path matches.
- '**'
paths:
- 'api/**'
- '.github/workflows/docs-build.yaml'
- '.github/actions/python/**'
- '.github/actions/webstack/deploy-to-sandbox/**'
- '.github/workflows/utils.js'
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
name: opentrons documentation build
runs-on: 'ubuntu-18.04'
steps:
- uses: 'actions/checkout@v2'
- uses: 'actions/setup-node@v1'
with:
node-version: '14'
- uses: 'actions/setup-python@v2'
with:
python-version: '3.7'
- uses: './.github/actions/python/setup'
with:
project: 'api'
- name: 'set complex environment variables'
uses: actions/[email protected]
with:
script: |
const { buildComplexEnvVars, } = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/utils.js`)
buildComplexEnvVars(core, context)
- name: 'Setup Docs'
run: sudo apt-get install -y --no-install-recommends texlive-fonts-recommended texlive-latex-extra texlive-fonts-extra dvipng texlive-latex-recommended libsystemd-dev latexmk texlive-lang-greek
- name: 'Build docs'
run: |
make -C api docs
- name: 'Deploy docs to sandbox'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_SANDBOX_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SANDBOX_SECRET }}
uses: './.github/actions/webstack/deploy-to-sandbox'
with:
domain: 'docs.opentrons.com'
distPath: './api/docs/dist'
destPrefix: ${{ env.OT_BRANCH }}