forked from fastapi/fastapi
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (64 loc) · 1.91 KB
/
publish-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
name: Publish Site
on:
push:
branches:
- docs-kr
workflow_dispatch:
inputs:
update:
description: 'Publish App'
required: false
jobs:
publish-docs:
runs-on: ubuntu-18.04
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-v03
- name: Install Flit
if: steps.cache.outputs.cache-hit != 'true'
run: python3.7 -m pip install flit
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: python3.7 -m flit install --deps production --extras doc
- name: Install requirements
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r docs/requirements.txt
- name: Build Docs
run: python3.7 ./scripts/docs.py build-all
- name: Zip docs
run: zip -r docs.zip ./site
- name: Checkout release branch
uses: actions/checkout@v2
with:
ref: release
clean: false
- name: Unzip docs
run: |
unzip docs.zip -d .tmp
rm -f docs.zip
- name: Move static files
run: |
ls -al
rm -r .tmp/site/index.html
cp -r .tmp/site/* .
rm -rf .tmp docs_build site/
- name: Commit
run: |
ls -al
git config --local user.email 'deploy-bot@users.noreply.github.com'
git config --local user.name '[bot] Deploy'
git add .
git commit -m "👷 Deploy updates"
git push origin release