update pages deploy

This commit is contained in:
hzrd149 2024-05-06 08:51:08 -05:00
parent 7211690522
commit 5a0be3104c

View File

@ -30,26 +30,35 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
cache: "npm"
- name: Install dependencies
run: yarn install
- name: Set build env
run: |
echo "VITE_COMMIT_HASH=$(echo $GITHUB_SHA | cut -c 1-7)" >> $GITHUB_ENV
echo "VITE_APP_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV
- name: Build
run: yarn build
- name: Redirect 404 to Index for SPA
run: cp dist/index.html dist/404.html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: "./dist"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2