Update to modern tech and vite #51
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
| # Build and deploy the site | |
| name: Publish app | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| defaults: | |
| run: | |
| shell: bash | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: "16" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: "Tests" | |
| run: npm run test | |
| build_and_deploy: | |
| needs: test | |
| runs-on: [ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/setup-node@v2 | |
| with: | |
| node-version: "16" | |
| - name: Install dependencies | |
| run: npm ci | |
| - run: mkdir -p public | |
| - name: Generate bundled files | |
| run: npm run build | |
| - name: Move static assets | |
| run: npm run static | |
| - name: Generate the index file | |
| run: | | |
| npm run svg | |
| node ./src/functions/ssr.js | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v1 | |
| with: | |
| # Upload entire repository | |
| path: "public" | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v1 |