Skip to content

fix ci

fix ci #3

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
env:
NODE_VERSION: '18'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: './www/package-lock.json'
- name: Install dependencies
run: |
cd www
npm ci
- name: Build project
run: |
cd www
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' && github.event_name != 'pull_request'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./www/dist
commit_message: ${{ github.event.head_commit.message }}
force_orphan: true
deploy:
needs: build-and-deploy
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
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@v4