-
Notifications
You must be signed in to change notification settings - Fork 939
77 lines (70 loc) · 2.21 KB
/
deploy_website.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
name: Deploy Website 🚀
# Only run this workflow on pushes to a particular branch
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout main 🛎️
uses: actions/checkout@v2
# If you're using actions/checkout@v2 you must set persist-credentials to false in most
# cases for the deployment to work correctly.
with:
persist-credentials: false
# 0 here indicates fetch all history for proper doc setup
fetch-depth: 0
ref: main
path: mmf_main
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: mmf
python-version: 3.7
auto-update-conda: true
use-only-tar-bz2: true
- name: Setup Node 🔧
uses: actions/setup-node@v2-beta
with:
node-version: '12.17.0'
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache conda and node modules
uses: actions/cache@v2
env:
# Increase this value to reset cache if nothing has not changed but you still
# want to invalidate the cache
CACHE_NUMBER: 0
with:
path: |
/usr/share/miniconda/envs/
${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-mmf-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/yarn.lock') }}
- name: Install and build MMF
shell: bash -l {0}
run: |
conda activate mmf
cd ${GITHUB_WORKSPACE}/mmf_main
python setup.py install
python -c 'import torch; print("Torch version:", torch.__version__)'
python -m torch.utils.collect_env
cd website
node -v
yarn -v
yarn install --frozen-lockfile
cd ..
cd docs
pip install -r requirements.txt
cd ..
./website/build_docs.sh -b
pwd
- name: Deploy 🚀
# Skip on forks
if: github.event.repository.fork == false
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./mmf_main/website/build