forked from starknet-io/starknet.js
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.39 KB
/
push-docs-build-commit.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
name: '[Push] Documentation Build Commit'
on:
push:
branches:
- develop
paths:
- 'src/**'
- 'www/**'
jobs:
skip_check:
name: Skip check
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_duplicate.outputs.should_skip }}
steps:
- id: skip_duplicate
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
build_docs:
name: Documentation build
needs: [skip_check]
if: needs.skip_check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- uses: actions/setup-node@v3
with:
node-version: lts/*
cache: 'npm'
- name: Setup
run: |
npm ci --ignore-scripts
cd www/
npm ci --ignore-scripts
- name: Build
run: |
npm run docs:build
npm run format
- name: Check changes
run: |
git add www
git diff-index --cached --quiet HEAD || echo "has_changes=true" >> "$GITHUB_ENV"
echo ${{ env.has_changes }}
- name: Create commit
if: env.has_changes == 'true'
run: |
git config --global user.name 'CI'
git config --global user.email '[email protected]'
git commit -m "docs: generate documentation"
git push