-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (42 loc) · 1.59 KB
/
deploy-github-page.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
name: deploy github page using vitepress
on:
push:
branches:
- main
env:
DOMAIN: blog.usword.cn
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
REPOSITORY: ${{ github.repository }}
OWNER: ${{ github.repository_owner }}
EMAIL: "[email protected]"
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_APP_KEY: ${{ secrets.ALGOLIA_APP_KEY }}
ALGOLIA_APP_INDEXNAME: ${{ secrets.ALGOLIA_APP_INDEXNAME }}
GITALK_ID: ${{ secrets.GITALK_ID }}
GITALK_SECRET: ${{ secrets.GITALK_SECRET }}
jobs:
build-and-deploy:
name: deploy github page
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: install pnpm
run: yarn global add pnpm
- name: set env variables
run: echo ALGOLIA_APP_ID=${{ env.ALGOLIA_APP_ID }} >> .env && echo ALGOLIA_APP_KEY=${{ env.ALGOLIA_APP_KEY }} >> .env && echo ALGOLIA_APP_INDEXNAME=${{ env.ALGOLIA_APP_INDEXNAME }} >> .env && echo GITALK_ID=${{ env.GITALK_ID }} >> .env && echo GITALK_SECRET=${{ env.GITALK_SECRET }} >> .env
- name: build project
run: pnpm install --no-frozen-lockfile && pnpm build
- run: ls
- name: generate sitemap
run: chmod +x ./scripts/generate-sitemap.sh && ./scripts/generate-sitemap.sh
- name: deploy page
run: chmod +x ./scripts/deploy-page.sh && ./scripts/deploy-page.sh
# use other action
# - name: deploy github page
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: ${{ env.BUNDLE_DIST }}