Skip to content
name: build and deploy
on:
push:
branches: ["main"]
env:
NODE_VERSION: 20
jobs:
build:
name: build
runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install
- run: npm run build:production
deploy:
needs: build
name: deploy
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# # Specify runner + deployment step
# runs-on: ubuntu-latest
steps:
# - name: Fix permissions
# run: |
# chmod -c -R +rX "_site/" | while read line; do
# echo "::warning title=Invalid file permissions automatically fixed::$line"
# done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# steps:
# - uses: actions/checkout@v4
# - name: Deploy
# uses: JamesIves/github-pages-deploy-action@4.1.4
# with:
# branch: gh-pages
# folder: dist
# registry-url: 'https://registry.npmjs.org'
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node-version }}