-
Notifications
You must be signed in to change notification settings - Fork 10
59 lines (59 loc) · 2.18 KB
/
deploy.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
name: Build and Deploy
on:
push:
branches:
- dev # only trigger deployment upon pushes to master branch
pull_request:
branches:
- dev
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Install SSH Client
continue-on-error: true
uses: webfactory/ssh-agent@v0.2.0
with:
ssh-private-key: ${{ secrets.FRANKLIN_PRIV }}
# Python is necessary for pre-rendering steps as well as to install
# matplotlib which is necessary if you intend to use PyPlot. If you do
# not, then you can remove the `run: pip install matplotlib` line.
- name: Install python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install Julia
uses: julia-actions/setup-julia@v1
with:
version: '1.10'
# This ensures that NodeJS and Franklin are loaded then it installs
# highlight.js which is needed for the prerendering step.
# Then the environment is activated and instantiated to install all
# Julia packages which may be required to successfully build your site.
# NOTE: the last line should be `optimize()`, you may want to give it
# specific arguments, see the documentation or ?optimize in the REPL.
- name: Build site
run: julia -e '
using Pkg; Pkg.add(["NodeJS", "Franklin"]);
using NodeJS; run(`$(npm_cmd()) install highlight.js`);
using Franklin; optimize();
cp(joinpath("__site", "feed.xml"), joinpath("__site", "index.xml"))'
- name: Deploy (preview)
continue-on-error: true
if: github.event_name == 'pull_request'
uses: JamesIves/github-pages-deploy-action@3.4.2
with:
SSH: true
BRANCH: gh-preview
FOLDER: __site
- name: Deploy (main)
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: master
FOLDER: __site