Skip to content

Commit

Permalink
build to gh
Browse files Browse the repository at this point in the history
  • Loading branch information
hitchhooker committed Aug 15, 2024
1 parent 994d113 commit 7f9f337
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/deploy_pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Deploy to GitHub Pages

on:
push:
branches: [master] # Set this to your default branch
pull_request:
branches: [master]

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Adjust this to match your project's Node.js version

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build Rust WASM
run: wasm-pack build --target web

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build
env:
VITE_MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist # Adjust this to match your build output directory

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./dist # Adjust this to match your build output directory

deploy:
needs: build-and-deploy
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 3 additions & 0 deletions www/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export default defineConfig({
resolve(__dirname, 'node_modules')
],
},
prerender: {
crawllinks: true
}
},
build: {
target: 'esnext',
Expand Down

0 comments on commit 7f9f337

Please sign in to comment.