forked from mouseless/learn-nuxt
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (52 loc) · 1.22 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
name: Publish
on:
push:
branches:
- main
- 'issue/**'
jobs:
generate:
name: Generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 22
- name: Build Docs
run: |
cd .theme/
npm install
npm run generate:production
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: docs
path: .theme/.output/public
if-no-files-found: error
publish:
needs: generate
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: deploy
- name: Remove Old Files
run: |
git rm -rf .
git clean -fxd
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: docs
- name: Commit & Push
run: |
git config user.name 'github-actions'
git config user.email '[email protected]'
git add -A
git commit -m 'deploy to github pages'
git push -f