forked from loongson/LoongArch-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.45 KB
/
preview.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
name: Preview
on:
pull_request_target:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: Gemfile
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Build
run: |
bundle exec rake book:all
- name: Copy
run: |
mkdir -p public
mv README.html index.html
cp *.html public
cp *.pdf public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: loongson/LoongArch-Documentation-Preview
publish_branch: gh-pages
publish_dir: ./public
- name: Update status
uses: Sibz/github-status-action@v1
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: 'LoongArch Documentation Preview / Deploy (update)'
description: 'Deployed, click "Details" to view ->'
state: 'success'
target_url: https://loongson.github.io/LoongArch-Documentation-Preview
sha: ${{ github.event.pull_request.head.sha || github.sha }}