Skip to content

Commit

Permalink
handle custom base
Browse files Browse the repository at this point in the history
  • Loading branch information
davydkov committed Oct 27, 2023
1 parent a6ebe35 commit b0a7591
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concurrency:

jobs:
# Build job
build:
build-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -33,23 +33,28 @@ jobs:
with:
node-version: "20"
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
run: npx likec4 build -o ./dist --base "${{ steps.pages.outputs.base_path }}"
# GitHub Pages doesn't allow to configure routing for single page apps,
# So we copy index.html to 404.html to make it work
- name: Custom 404 page
run: cp ./dist/index.html ./dist/404.html
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./dist

# Deployment job
deploy:
deploy-pages:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
needs: build-pages
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "likec4 serve",
"dev": "likec4 serve",
"build": "likec4 build -o ./dist",
"build": "likec4 build",
"export:png": "likec4 export png -o ./png"
},
"devDependencies": {
Expand Down

0 comments on commit b0a7591

Please sign in to comment.