-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.43 KB
/
ci.yaml
File metadata and controls
58 lines (52 loc) · 1.43 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
name: deploy-site
on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
if: github.repository == 'ProjectPythiaTutorials/projectpythiatutorials.github.io'
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.10.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@master
with:
channels: conda-forge,nodefaults
channel-priority: strict
activate-environment: pythia
auto-update-conda: false
python-version: 3.9
environment-file: ci/environment.yml
mamba-version: '*'
use-mamba: true
- name: Build
run: |
conda env list
cd site
make -j4 html
- name: Zip the site
run: |
set -x
set -e
if [ -f site.zip ]; then
rm -rf site.zip
fi
zip -r site.zip ./site/_build/html
- uses: actions/upload-artifact@v3
with:
name: site-zip
path: ./site.zip
- name: Deploy
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site/_build/html
cname: tutorials.projectpythia.org