fix: Change base path for unlighthouse build

This commit is contained in:
Bart van der Braak 2023-06-10 20:38:41 +02:00
parent 106b07a8ad
commit d42570b4c4

View file

@ -33,6 +33,10 @@ jobs:
- name: Build Unlighthouse report
run: unlighthouse-ci --site "https://omnidash.io" --build-static
- name: Add base href to `index.html`
run: |
node -e "const fs = require('fs'); const file = './.unlighthouse/index.html'; let html = fs.readFileSync(file, 'utf-8'); html = html.replace(/<head>([\s\S]*?)<\/head>/, (match, headContent) => '<head>' + headContent + '<base href=\"/${{ github.event.repository.name }}/\"></head>'); fs.writeFileSync(file, html);"
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v1.0.8
with: