Attempting to fix possible XSS vector #18
This file contains 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
name: build-site | |
on: | |
# Triggers the workflow on push events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
# Sets up a recent version of Node.js | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
# Build site with webpack | |
- name: Build static site | |
run: | | |
npm install | |
BASE_URL=/elucidate/ npm run build:bundle | |
touch $GITHUB_WORKSPACE/dist/.nojekyll | |
# Emit JSON endpoint indicating job success (accessing via API is complicated) | |
- name: JSON endpoint on success | |
if: ${{ success() }} | |
run: python -c 'import json; print(json.dumps(dict(schemaVersion=1, label="build-site", style="for-the-badge", namedLogo="github", message="success", color="green")))' > $GITHUB_WORKSPACE/dist/endpoint.json | |
# Emit JSON endpoint indicating job failure (accessing via API is complicated) | |
- name: JSON endpoint on failure | |
if: ${{ failure() }} | |
run: python -c 'import json; print(json.dumps(dict(schemaVersion=1, label="build-site", style="for-the-badge", namedLogo="github", message="failure", color="red")))' > $GITHUB_WORKSPACE/dist/endpoint.json | |
# Push all the new assets to the pages branch | |
- name: Push to Github Pages branch | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: gh-pages | |
FOLDER: dist | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MESSAGE: "Build ({sha}): {msg}" |