Merge pull request #594 from hed-standard/dependabot/npm_and_yarn/mai… #165
This file contains hidden or 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
# A descriptive name for your workflow | |
name: Deploy Vite App to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
# Allow only one concurrent deployment, cancelling any previously running ones. | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: true | |
permissions: {} | |
jobs: | |
#-------------------------------------- | |
# Build Job: Prepares the application | |
#-------------------------------------- | |
build: | |
permissions: | |
contents: read # Or another more restrictive permission if possible. | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main branch | |
uses: actions/checkout@v5 | |
- name: Set up Node.js | |
uses: actions/setup-node@v5 | |
with: | |
node-version: 22 | |
# Cache npm dependencies to speed up future builds | |
cache: 'npm' | |
cache-dependency-path: | | |
package-lock.json | |
browser/package-lock.json | |
- name: Install root dependencies | |
run: npm ci | |
- name: Remove browser package-lock.json and node_modules | |
working-directory: ./browser | |
run: rm -rf package-lock.json node_modules | |
- name: Install browser dependencies | |
# Specifies the working directory for the command | |
working-directory: ./browser | |
run: npm install | |
- name: Build hed-validator package | |
run: npm run build | |
- name: Link hed-validator package | |
run: npm link | |
- name: Link dependency for browser build | |
working-directory: ./browser | |
run: npm link hed-validator | |
- name: Build documentation | |
run: npx typedoc --options typedoc.json --tsconfig tsconfig.json | |
- name: Build Vite site | |
working-directory: ./browser | |
run: npm run build | |
- name: Upload artifact for deployment | |
uses: actions/upload-pages-artifact@v4 | |
with: | |
# Specifies the directory to upload. This should match your build output folder. | |
path: ./browser/buildweb | |
#------------------------------------------------ | |
# Deploy Job: Deploys the built site | |
#------------------------------------------------ | |
deploy: | |
# This job depends on the 'build' job completing successfully | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
runs-on: ubuntu-latest | |
# Specify the deployment environment | |
environment: | |
name: github-pages | |
# The URL will be automatically set by the deployment step's output | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
# This is the official action for deploying the artifact to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |