Added preload post build script

This commit is contained in:
2025-10-31 19:31:07 +03:30
parent 1fe13e5208
commit d2255cefb7
5 changed files with 85 additions and 38 deletions

View File

@@ -1,44 +1,44 @@
name: Deploy to GitHub Pages
# name: Deploy to GitHub Pages
on:
push:
branches: [main]
pull_request:
branches: [main]
# on:
# push:
# branches: [main]
# pull_request:
# branches: [main]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
# jobs:
# build-and-deploy:
# runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false
# - uses: pnpm/action-setup@v4
# name: Install pnpm
# with:
# version: 10
# run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
# - name: Install Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'pnpm'
- name: Install dependencies
run: pnpm install
# - name: Install dependencies
# run: pnpm install
- name: Build project
run: DEPLOY_ENV=GH_PAGES pnpm build
# - name: Build project
# run: DEPLOY_ENV=GH_PAGES pnpm build
- name: Copy index.html to 404.html
run: cp dist/index.html dist/404.html
# - name: Copy index.html to 404.html
# run: cp dist/index.html dist/404.html
- name: Deploy to GitHub Pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages
# - name: Deploy to GitHub Pages
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# uses: peaceiris/actions-gh-pages@v4
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./dist
# publish_branch: gh-pages