change deployment workflow node version to 22 #2
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 push to build branch | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Fix legacy OpenSSL error | |
| run: export NODE_OPTIONS=--openssl-legacy-provider | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build production bundle | |
| run: npm run build # or "webpack --mode=production" if no script | |
| - name: Deploy to build branch | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GH_TOKEN }} | |
| publish_dir: ./public | |
| publish_branch: build | |
| force_orphan: true # optional: cleans the branch history |