name: Deploy to Pages # The mochi version of .github/workflows/deploy.yml, which it shadows. # Two differences, both forced by the vault: `actions/checkout` with a # `repository:` names a repository in this vault, so numbl is cloned from # github.com with git; and there is no cache service, so `cache: npm` is # dropped rather than warned about on every run. on: push: branches: [main] schedule: - cron: "0 6 * * *" workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: pages cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: # Mirror the local dev layout, where the app sits one level below the # vault root alongside a checkout of numbl: # /repos/numbl-figure-viewer (this app) # /numbl (numbl main) # so the app's `"numbl": "file:../../numbl"` resolves to /numbl. # Only the nesting depth matters here; the `repos/` name is arbitrary. - name: Checkout app uses: actions/checkout@v4 with: path: repos/numbl-figure-viewer - name: Clone numbl (main) run: git clone --depth 1 --branch main https://github.com/flatironinstitute/numbl.git numbl - uses: actions/setup-node@v4 with: node-version: 22 # Build the numbl/graphics browser bundle the app imports. (HUSKY=0 skips # the git-hook setup in numbl's prepare script; numbl's own install script # is a no-op, so no native addon is built.) - name: Build numbl/graphics working-directory: numbl env: HUSKY: 0 run: | npm ci npm run build:graphics - name: Install app dependencies working-directory: repos/numbl-figure-viewer run: npm install - name: Build app working-directory: repos/numbl-figure-viewer run: npm run build:pages - uses: actions/configure-pages@v5 - uses: actions/upload-pages-artifact@v3 with: path: repos/numbl-figure-viewer/dist deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment uses: actions/deploy-pages@v4