-
Notifications
You must be signed in to change notification settings - Fork 5
80 lines (70 loc) · 2.8 KB
/
docs-publish.yml
File metadata and controls
80 lines (70 loc) · 2.8 KB
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
78
79
80
name: Build and deploy jekyll site
on:
push:
branches:
- sources
jobs:
jekyll:
runs-on: ubuntu-16.04 # can change this to ubuntu-latest if you prefer
steps:
- name: 📂 setup
uses: actions/checkout@v2
# include the lines below if you are using jekyll-last-modified-at
# or if you would otherwise need to fetch the full commit history
# however this may be very slow for large repositories!
# with:
# fetch-depth: '0'
- name: Checkout submodules
uses: textbook/git-checkout-submodule-action@master
- id: find # this step is needed to provide the cache directory and cache hash key
name: 📂 find jekyll directory
run: |
JEKYLL_SRC=$(find . -path ./vendor/bundle -prune -o -name _config.yml -exec dirname {} \; | tr -d '\n')
JEKYLL_HASH=$(ls -alR --full-time ${JEKYLL_SRC} | sha1sum)
echo "::set-output name=jekyllSrc::${JEKYLL_SRC}"
echo "::set-output name=jekyllHash::${JEKYLL_HASH}"
- name: 📝 cache bundler files
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
- name: 📝 cache jekyll files
uses: actions/cache@v1
with:
path: ${{ steps.find.outputs.jekyllSrc }}/.jekyll-cache
key: ${{ runner.os }}-jekyll-${{ steps.find.outputs.jekyllHash }}
restore-keys: |
${{ runner.os }}-jekyll-
- name: 💎 setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6 # can change this to 2.7 or whatever version you prefer
- name: 🔨 install dependencies & build site
uses: limjh16/jekyll-action-ts@v2
with:
jekyll_src: ${{ steps.find.outputs.jekyllSrc }}
- name: 🔍 Create Algolia index
run: bundle exec jekyll algolia
env:
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_KEY }}
- name: 🚀 deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
# if the repo you are deploying to is <username>.github.io, uncomment the line below.
# if you are including the line below, make sure your source files are NOT in the master branch:
publish_branch: master
- name: Copy to website
uses: andstor/copycat-action@v3
with:
personal_token: ${{ secrets.CI_PAT }}
src_path: /.
src_branch: master
dst_path: /docs/developer/.
dst_branch: gh-pages
dst_owner: enso-org
dst_repo_name: website
clean: true