Skip to content

Build before publish (#35) #5

Build before publish (#35)

Build before publish (#35) #5

Workflow file for this run

name: Release to GitHub Pages
on:
push:
tags: ["*"]
jobs:
release:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
- name: Build component
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
npm install
npm run build
- name: Copy index and data files
run: |
cp ./src/public/index.html ./dist/index.html
cp ./src/public/assessment-data.yaml ./dist/assessment-data.yaml
cp ./src/public/config.yaml ./dist/config.yaml
- name: Get tag name
id: get_tag_name
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./dist
destination_dir: ${{ env.TAG_NAME }}