-
-
Notifications
You must be signed in to change notification settings - Fork 46
63 lines (55 loc) · 2.1 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Deploy
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache pnpm modules
uses: actions/cache@v4
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/[email protected]
with:
version: 8.x.x
run_install: true
- run: |
export NODE_OPTIONS=--max-old-space-size=32768
pnpm run build
- run: echo '22333322.xyz' > dist/CNAME
- name: Prepare tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME="${GITHUB_REF##refs/tags/}"
echo "::set-output name=tag_name::${TAG_NAME}"
echo "::set-output name=deploy_tag_name::page_${TAG_NAME}"
- name: Archive Version Tag
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
tag_name: ${{ steps.prepare_tag.outputs.deploy_tag_name }}
tag_message: 'Store ${{ steps.prepare_tag.outputs.tag_name }}'
force_orphan: true
env:
CI: true
# VITE_APP_PUBLIC_URL: ${{ secrets.VITE_APP_PUBLIC_URL }}
VITE_APP_PUBLIC_URL: https://fastly.jsdelivr.net/gh/mx-space/mx-admin@gh-pages/