-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (70 loc) · 2.22 KB
/
build.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
name: build
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
timeout-minutes: 25
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout lndocs
uses: actions/checkout@v3
with:
repository: laminlabs/lndocs
ssh-key: ${{ secrets.READ_LNDOCS }}
path: lndocs
ref: main
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: ".github/workflows/build.yml"
- name: cache pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install Python dependencies
run: |
python -m pip install -U pip
pip install -U laminci
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
# - run: nox -s lint
# - run: nox -s install
- run: nox -s pull_artifacts
- run: nox -s docs
- name: Read lamin-project.yaml
id: lamin-project
uses: CumulusDS/[email protected]
with:
file: lamin-project.yaml
project_slug: project_slug
- name: Change base URL to project-slug
if: github.event_name == 'push'
run: |
mv _build/html _build/html_tmp
mkdir _build/html
mv _build/html_tmp _build/html/${{ steps.lamin-project.outputs.project_slug }}
- name: Deploy docs
id: netlify
uses: nwtgck/[email protected]
with:
publish-dir: "_build/html"
production-deploy: ${{ github.event_name == 'push' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}