Add deploy to Github Pages workflow #1
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
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fetch latest repository | |
| uses: actions/checkout@v4 | |
| - name: Using Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Setup dependencies | |
| run: | | |
| NODE_ENV=production yarn | |
| cache: "yarn" | |
| - name: Build project | |
| run: | | |
| NODE_ENV=production yarn build | |
| - name: Upload production artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: github-pages | |
| path: | | |
| dist | |
| - name: Publishing production artifact | |
| uses: actions/deploy-pages@v4 | |
| with: | |
| artifact_name: github-pages |