fix static files #6
This file contains 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 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 | |
- name: Copy static files | |
run: cp -r ./public/. ./dist | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist | |
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: Setup Pages | |
# uses: actions/configure-pages@v4 | |
# - 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 }} |