-
Notifications
You must be signed in to change notification settings - Fork 384
52 lines (46 loc) · 1.36 KB
/
preview docsy.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: 🔂 Crane PR Docs Preview - Docsy
on:
pull_request_target:
# when using teardown: 'true', add default event types + closed event type
types: [opened, synchronize, reopened, closed]
paths:
- "site/**"
- "**.md"
- "*.toml"
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}}
- 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: |
cd site
npm i
hugo --minify
- uses: afc163/surge-preview@v1
with:
surge_token: ${{ secrets.SURGE_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
dist: site/public
teardown: "true"
build: |
date