Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
branches: [main]
workflow_dispatch:

# Our jobs can only read our repository by default, so that our build (which runs the install scripts of our
# dependencies) can't deploy anything. Only our deploy job can (see its permissions).

permissions:
contents: read
pages: write
id-token: write

# Only deploy one version of our demo app at a time, letting a deployment that has started finish, since cancelling it
# could leave GitHub Pages in an inconsistent state.
Expand All @@ -31,8 +32,6 @@ jobs:
run: bun install --frozen-lockfile
- name: Build OpenCOR Plot's demo app
run: bun build:demo
- name: Configure GitHub Pages
uses: actions/configure-pages@v6
- name: Upload OpenCOR Plot's demo app
uses: actions/upload-pages-artifact@v5
with:
Expand All @@ -41,6 +40,14 @@ jobs:
name: Deploy
needs: build
runs-on: ubuntu-26.04
# Note #1: actions/deploy-pages needs to deploy to GitHub Pages and to get an OIDC token to prove where our demo app
# comes from (see https://github.com/actions/deploy-pages#usage).
# Note #2: GitHub Pages must have been enabled for our repository, with GitHub Actions as its source (see
# https://github.com/opencor/plot/settings/pages), since our GITHUB_TOKEN can't enable it (only a token
# with admin rights can, e.g. using actions/configure-pages with its enablement input).
permissions:
pages: write
id-token: write
Comment thread
agarny marked this conversation as resolved.
Resolved
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down