This repository was archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.18 KB
/
Copy pathdocs.yml
File metadata and controls
76 lines (65 loc) · 2.18 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Documentation
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
deloy:
if: ${{ github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !github.event.pull_request.draft) }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
timeout-minutes: 4
steps:
- name: Checkout PR
uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Set bundle path
run: bundle config set --local path 'vendor/bundle'
- name: Cache vendor
id: cache-modules
uses: actions/cache@v2
with:
path: docs/vendor
key: docs-ruby2.6-${{ hashFiles('docs/Gemfile.lock') }}
- name: Install dependencies
if: steps.cache-modules.outputs.cache-hit != 'true'
run: bundle install
- name: Build
run: bundle exec jekyll build
- name: Deploy to Staging
id: deploy-staging
if: github.event_name == 'pull_request'
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-comment: false
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_DOCS}}
working-directory: docs/_site
- name: Comment
if: github.event_name == 'pull_request'
uses: NejcZdovc/comment-pr@v1
with:
file: 'comment_docs.md'
identifier: 'GITHUB_ACTION_COMMENT_DOCS'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
URL: ${{steps.deploy-staging.outputs.preview-url}}
- name: Deploy to Production
if: github.event_name == 'push'
uses: amondnet/vercel-action@v20
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-comment: false
vercel-org-id: ${{ secrets.VERCEL_ORG_ID}}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_DOCS}}
vercel-args: '--prod'
working-directory: docs/_site