Better input format for shapes #1078
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build website | |
on: | |
push: | |
branches: [master] | |
tags: ['v*'] | |
pull_request: | |
# Check all PR | |
jobs: | |
build-website: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# we need the full history to be able to get the chemiscope version with | |
# git describe during the build | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
cache: 'npm' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: configure access to git repositories in package-lock.json | |
run: git config --global url."https://github.com/".insteadOf ssh://[email protected] | |
- name: install npm dependencies | |
run: npm ci | |
- name: install python dependencies | |
run: | | |
python3 -m pip install -r docs/requirements.txt | |
python3 -m pip install beautifulsoup4 requests | |
- run: npm run build | |
- run: npm run download-examples | |
- run: cd docs && make html | |
- run: python3 utils/generate_standalone.py -o chemiscope_standalone.html | |
- name: assemble full website | |
run: | | |
cp -r app/ gh-pages/ | |
cp dist/*.min.js gh-pages/ | |
cp chemiscope_standalone.html gh-pages/ | |
cp -r docs/build/html/ gh-pages/docs/ | |
rm -f gh-pages/examples/.gitignore | |
- name: deploy website to gh-pages | |
# only deploy website from master | |
if: github.ref == 'refs/heads/master' | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./gh-pages/ | |
cname: chemiscope.org | |
force_orphan: true | |
- name: upload minified JS to GitHub release | |
# only upload minified JS from tags | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
dist/chemiscope.d.ts | |
dist/chemiscope.min.js | |
dist/molecule-viewer.min.js | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |