-
Notifications
You must be signed in to change notification settings - Fork 166
54 lines (46 loc) · 1.28 KB
/
publish-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
45
46
47
48
49
50
51
52
53
54
# .github/workflows/preview.yml
name: Deploy Github Pages
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- closed
permissions:
contents: write
pull-requests: write
concurrency: ci-${{ github.ref }}
jobs:
publish:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install and Build
working-directory: docs
env:
# Main: https://tanka.dev/
# PRs: https://tanka.dev/pr-preview/pr-{number}/
PATH_PREFIX: "${{ github.event_name == 'pull_request' && format('/pr-preview/pr-{0}', github.event.number) || '' }}"
run: |
yarn install
yarn build
- name: Deploy main
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
clean-exclude: pr-preview/
folder: ./docs/public/
- name: Deploy preview
if: github.event_name == 'pull_request'
uses: rossjrw/pr-preview-action@v1
with:
deploy-repository: ${{ github.event.pull_request.head.repo.full_name }}
source-dir: ./docs/public/