-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (48 loc) · 1.42 KB
/
Deploy.yml
File metadata and controls
53 lines (48 loc) · 1.42 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
name: Build and Deploy
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize]
env:
GH_USERNAME: "bonhamlab"
PREVIEWS_PREFIX: "previews/PR" # will be followed by PR number
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.VAULT_DEPLOY_KEY }}
submodules: true
fetch-depth: 0
- name: 👀 Set preview path for PRs
run: |
if ${{ github.event_name == 'pull_request' }}
then
echo 'PRID=${{ env.PREVIEWS_PREFIX}}${{ github.event.number}}' >> $GITHUB_ENV
else
echo 'PRID=' >> $GITHUB_ENV
fi
shell: bash
- name: 🚀 Build and Deploy
uses: kescobo/xranklin-build-action@main
with:
SITE_FOLDER: "./"
BASE_URL_PREFIX: ${{ env.REPO_PREFIX }}
PREVIEW: ${{ env.PRID }}
# PYTHON_LIBS: "pandas ansi2html"
# GNUPLOT: false
# LUNR: true
- name: 🗒️ Preview URL indication for PRs
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Preview should be up in a couple of mins at
https://lab.bonham.ch/${{ env.PRID }}
(if you get a 404, wait 30s then refresh).
if: github.event_name == 'pull_request'