add demo-project 2 #9
This file contains hidden or 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 and deploy to Github pages | |
| on: | |
| push: | |
| branches: [master, v2-demo] | |
| env: | |
| # NOTE: DEPLOY_PATH is only set when using Github pages URL that includes a | |
| # subpath, not a separate stand-alone domain name pointing to built assets. | |
| DEPLOY_PATH: ${{ vars.DEPLOY_PATH }} | |
| PUBLIC_MAPBOX_TOKEN: ${{ secrets.PUBLIC_MAPBOX_TOKEN }} | |
| PUBLIC_SENTRY_DSN: ${{ secrets.PUBLIC_SENTRY_DSN }} | |
| PUBLIC_GOOGLE_ANALYTICS_ID: ${{ secrets.PUBLIC_GOOGLE_ANALYTICS_ID }} | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install NodeJS | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: ".nvmrc" | |
| - name: Install dependencies | |
| run: npm ci --include=dev | |
| - name: Build | |
| run: npm run build | |
| - name: Upload built artifacts | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "build/" | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |