forked from loongson/LoongArch-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.42 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
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@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Build
run: bundle exec rake book:all
- 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
destination_dir: ${{ github.event.pull_request.number }}
- 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/${{ github.event.pull_request.number }}
sha: ${{ github.event.pull_request.head.sha || github.sha }}