generated from fastai/fastpages
-
Notifications
You must be signed in to change notification settings - Fork 3
executable file
·58 lines (49 loc) · 1.61 KB
/
ci.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
name: CI
on:
push:
branches:
- master # need to filter here so we only deploy when there is a push to master
# no filters on pull requests, so intentionally left blank
pull_request:
workflow_dispatch:
jobs:
build-site:
if: ( github.event.commits[0].message != 'Initial commit' ) || github.run_number > 1
runs-on: ubuntu-latest
steps:
- name: Check if secret exists
if: github.event_name == 'push'
run: |
if [ -z "$deploy_key" ]
then
echo "You do not have a secret named SSH_DEPLOY_KEY. This means you did not follow the setup instructions carefully. Please try setting up your repo again with the right secrets."
exit 1;
fi
env:
deploy_key: ${{ secrets.SSH_DEPLOY_KEY }}
- name: Copy Repository Contents
uses: actions/checkout@main
with:
persist-credentials: false
- name: convert notebooks and word docs to posts
uses: ./_action_files
- name: setup directories for Jekyll build
run: |
rm -rf _site
sudo chmod -R 777 .
- name: Jekyll build
uses: docker://fastai/fastpages-jekyll
with:
args: bash -c "jekyll build -V --strict_front_matter --trace"
env:
JEKYLL_ENV: 'production'
- name: copy CNAME file into _site if CNAME exists
run: |
sudo chmod -R 777 _site/
cp CNAME _site/ 2>/dev/null || :
- name: Deploy
if: github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.SSH_DEPLOY_KEY }}
publish_dir: ./_site