Move npm run build as part of docker build (#129)
#103
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: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| - closed | |
| concurrency: preview-${{ github.ref }} | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| if: github.event.action != 'closed' | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install dependencies | |
| if: github.event.action != 'closed' | |
| run: npm install | |
| - name: build | |
| if: github.event.action != 'closed' | |
| env: | |
| BASE_PATH: '/${{ github.event.repository.name }}' | |
| run: | | |
| npm run build | |
| - name: Copy in sample data | |
| if: github.event.action != 'closed' | |
| run: cp -r sample-data build/data | |
| - name: Add nojekyll file | |
| if: github.event.action != 'closed' | |
| run: touch build/.nojekyll | |
| - name: 🚀 Deploy main page | |
| if: ${{ github.event_name == 'push' }} | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: build # The folder the action should deploy. | |
| clean: true | |
| force: false | |
| clean-exclude: | | |
| .nojekyll | |
| pr-preview/ | |
| - name: 🛸 Deploy PR preview | |
| if: ${{ github.event_name == 'pull_request' }} | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| source-dir: build | |
| preview-branch: gh-pages | |
| umbrella-dir: pr-preview | |
| action: auto |