-
Notifications
You must be signed in to change notification settings - Fork 46
87 lines (83 loc) · 2.69 KB
/
build_documentation.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build Cloud SDK Documentation
on:
pull_request:
branches: [main]
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Vale Linter
# You may pin to the exact commit or the version.
# uses: errata-ai/vale-action@0da98680790f89b8d5b685de9c264f55addc971b
uses: errata-ai/vale-action@v2.0.1
with:
# A list of styles to install prior to running Vale.
# styles: # optional
# An externally-hosted configuration file to use.
config: https://raw.githubusercontent.com/SAP/cloud-sdk/main/.vale.ini
# The files to lint: "all" or "<some_folder>".
files: __onlyModified
# Only post annotations on lines that have changed within a PR.
onlyAnnotateModifiedLines: true # optional, default is false
# Log debugging information to stdout
debug: false # optional, default is false
env:
# Required
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 16
- uses: actions/cache@v3
id: cache
with:
path: node_modules
key: ubuntu-latest-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: ESlint and Prettier
run: npm run lint
build:
runs-on: ubuntu-latest
needs: [checks]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 16
- uses: actions/cache@v3
id: cache
with:
path: node_modules
key: ubuntu-latest-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Build docs
run: npm run build
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
needs: [build]
permissions:
pull-requests: write
contents: write
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Approve a PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}