-
Notifications
You must be signed in to change notification settings - Fork 26
41 lines (39 loc) · 1.18 KB
/
publish.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
name: nmrium gh-pages tag publish
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: |
npm ci
npm i -g gh-pages
- name: Update version number
run: |
VERSION=${GITHUB_REF//*\/}
echo "export default { version: '$VERSION' };" > src/versionInfo.ts
- name: Build
run: |
rm src/demo/samples.json
mv src/demo/empty.json src/demo/samples.json
newPackage=$(jq 'setpath(["homepage"]; ".")' package.json)
echo $newPackage > package.json
npm run build
- name: Remove spectra
run: |
rm -rf build/data
rm -rf build/exercises
- name: Push to gh-pages
run: |
git config user.email [email protected]
git config user.name "Luc Patiny"
git remote set-url origin "https://lpatiny:${{ secrets.ACCESS_NMRIUM }}@github.com/zakodium/cdn.nmrium.org.git"
VERSION=${GITHUB_REF//*\/}
gh-pages --dest $VERSION -d build --dotfiles