-
Notifications
You must be signed in to change notification settings - Fork 401
93 lines (79 loc) · 2.75 KB
/
deploy.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# This GitHub workflow runs only on push to master.
# By this point, we are assuming that all checks on the PR,
# which are checked by the Azure Pipeline, have passed.
# The full pipeline is also leveraged here,
# as we don't want a broken website to be deployed anyways.
name: Deployments
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-deploy-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
cache: true
- name: Build website
run: |
pixi run python -m ipykernel install --user --name nams
pixi run build-docs
- name: Deploy Website
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
# https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-personal-access-token-personal_token
personal_token: ${{ secrets.GHPAGES_TOKEN }}
publish_dir: ./site
publish_branch: gh-pages
allow_empty_commit: false
keep_files: false
force_orphan: true
enable_jekyll: false
disable_nojekyll: false
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
if: github.event_name == 'pull_request'
with:
source-dir: ./site
build-docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/[email protected]
with:
pixi-version: v0.41.4
cache: true
- name: Build Docker image
run: |
docker build -t nams-docker -f scripts/Dockerfile .
# - name: Download environment tarball
# uses: actions/download-artifact@v3
# with:
# name: nams-tarball
# - name: Unpack environment and activate it
# run: bash scripts/ci/unpack_environment.sh
# - name: Build leanpub manuscript files
# run: |
# bash scripts/ci/build_leanpub.sh
# - name: Deploy Leanpub
# uses: peaceiris/actions-gh-pages@v3
# with:
# # https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-personal-access-token-personal_token
# personal_token: ${{ secrets.GHPAGES_TOKEN }}
# publish_dir: ./manuscript
# publish_branch: leanpub
# destination_dir: manuscript
# allow_empty_commit: false
# keep_files: false
# force_orphan: true
# enable_jekyll: false
# disable_nojekyll: false
# - name: Trigger publish on LeanPub
# run: curl -d "api_key=${{ secrets.LEANPUB_API_KEY }}" https://leanpub.com/nams/publish.json