Skip to content

Suggest fixes on dashboard PR #17

Suggest fixes on dashboard PR

Suggest fixes on dashboard PR #17

Workflow file for this run

name: Deploy Dashboard
on:
push:
branches: [master]
paths:
- '.github/workflows/dashboard.yml'
- 'dashboard/**'
- 'foreign/**'
- 'lib/**'
- 'package.json'
- 'spago.lock'
- 'spago.yaml'
pull_request:
types: [opened, reopened, synchronize, closed]
paths:
- '.github/workflows/dashboard.yml'
- 'dashboard/**'
- 'foreign/**'
- 'lib/**'
- 'package.json'
- 'spago.lock'
- 'spago.yaml'
permissions:
contents: write
pull-requests: write
concurrency: pages-${{ github.ref }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
if: github.event.action != 'closed'
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install tools
if: github.event.action != 'closed'
run: npm install --no-save purescript@0.15.15 spago@1.0.3 esbuild
# TODO: this is temporary until we fix a bug in spago for bundling single packages:
# there is a `purs graph` call that fails when doing that because it's trying to use
# all the dependencies of the package, which might not be there. So we build everything.
- name: Build whole repo
if: github.event.action != 'closed'
run: npx spago build
- name: Build dashboard
if: github.event.action != 'closed'
run: npm run dashboard:build
- name: Verify bundle
if: github.event.action != 'closed'
run: test -f dashboard/app.js
- name: Prepare deploy directory
if: github.event.action != 'closed'
run: |
mkdir -p _site
cp dashboard/index.html _site/
cp dashboard/app.js _site/
cp -r dashboard/static _site/
- name: Deploy to Pages
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site
clean-exclude: pr-preview
# On 'closed' events this removes the preview directory from gh-pages;
# on all other PR events it deploys the build to pr-preview/pr-<number>/.
- name: Deploy PR preview
if: github.event_name == 'pull_request'
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./_site/