fix:deploy #15
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: deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
push-to-gh-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Sed Config Base | |
shell: bash | |
run: | | |
sed -i "s#VITE_BUILD_COMPRESS\s*=.*#VITE_BUILD_COMPRESS = 'gzip'#g" ./.env.production | |
sed -i "s#VITE_DROP_CONSOLE\s*=.*#VITE_DROP_CONSOLE = true#g" ./.env.production | |
cat ./.env.production | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9 | |
run_install: false | |
- name: use Node.js 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
# - name: Get yarn cache directory path | |
# id: yarn-cache-dir-path | |
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
# | |
# - name: Cache dependencies | |
# uses: actions/cache@v3 | |
# with: | |
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
# restore-keys: | | |
# ${{ runner.os }}-yarn- | |
- name: Build | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
run: | | |
pnpm install --no-frozen-lockfile | |
pnpm build | |
touch dist/.nojekyll | |
cp dist/index.html dist/404.html | |
# - name: Delete gh-pages branch | |
# run: | | |
# git push origin --delete gh-pages | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ./dist | |
CNAME: uilist.com |