forked from gocrane/crane
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (43 loc) · 1.29 KB
/
Copy pathdocsy.yml
File metadata and controls
48 lines (43 loc) · 1.29 KB
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
name: 🔂 Crane PR Docs Preview - Docsy
on:
push:
paths:
- "site/**"
jobs:
preview:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: write
env:
HUGO_VERSION: 0.102.3
HUGO_ENVIRONMENT: production
HUGO_ENV: production
steps:
- uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- id: git-branch
run: |
echo "::set-output name=git-branch::$(echo ${GITHUB_REF##*/} | tr '[A-Z]' '[a-z]')"
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
- name: Build Docs
run: |
echo ${{steps.git-branch.outputs.git-branch}}
cd site
npm i
hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/public