Skip to content

add pwa stuff

add pwa stuff #62

Workflow file for this run

name: ci
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
container:
image: mambaorg/micromamba:latest
options: --user=root
steps:
- name: Install node
run: |
apt-get update
apt-get install curl -y
curl -fsSL https://deb.nodesource.com/setup_current.x | bash -
apt-get install -y nodejs
- uses: actions/checkout@master
# allow micromamba to activate env
# See https://micromamba-docker.readthedocs.io/en/latest/faq.html#how-can-i-use-a-mambaorg-micromamba-based-image-in-a-github-action
- shell: _entrypoint.sh /bin/bash --noprofile --norc -eo pipefail {0}
run: micromamba info
- name: Check out code
uses: actions/checkout@v3
- name: Install build env
run: |
micromamba install -n base \
--yes --file build-environment.yaml \
- name: Create web env
run: |
micromamba create \
--yes \
--platform=emscripten-32 \
--file web-environment.yaml
- name: Pack
shell: _entrypoint.sh /bin/bash --noprofile --norc -eo pipefail {0}
run: |
mkdir -p ./public/empack && mkdir -p ./src/pyjs
empack pack env \
--env-prefix=/opt/conda/envs/web \
--relocate-prefix=/ \
--no-use-cache \
--outdir=./public/empack \
--config=empack_config.yaml
- name: Copy runtime
run: |
cp /opt/conda/envs/web/lib_js/pyjs/pyjs_runtime_browser.js ./src/pyjs/
cp /opt/conda/envs/web/lib_js/pyjs/pyjs_runtime_browser.wasm ./public/
- name: Patch
run: npm run patch_runtime
- name: Build web app
run: npm install && npm run build
- name: Fix permissions
run: |
chmod -c -R +rX "./dist/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./dist
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy site to GitHub Pages
uses: actions/deploy-pages@v2