Skip to content

Commit 5494e2c

Browse files
authored
Docs CI (#86)
* added docs ci * fixed tags * typo
1 parent 5d34c94 commit 5494e2c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "docs"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "[0-9]+.[0-9]+.[0-9]+"
8+
9+
jobs:
10+
docs:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout the repository
14+
uses: actions/checkout@v3
15+
- name: Setup
16+
uses: ./.github/actions/setup
17+
- name: Checkout Docs Repository
18+
uses: actions/checkout@v3
19+
with:
20+
repository: solarity/docs
21+
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}
22+
path: docs
23+
- name: Generate and Copy Docs
24+
run: |
25+
npx hardhat markup --outdir markups
26+
rm -rf markups/contracts/mock
27+
rm -rf markups/contracts/interfaces
28+
rm -rf docs/docs/reference/contracts
29+
mkdir -p docs/docs/reference
30+
cp -r markups/contracts docs/docs/reference
31+
- name: Push Docs
32+
run: |
33+
git fetch --unshallow
34+
latest_tag=$(git describe --tags --abbrev=0)
35+
cd docs
36+
git config user.name "Docs Syncer"
37+
git add -f .
38+
if ! git diff-index --quiet HEAD; then
39+
git commit -m "CI: \`$latest_tag\`"
40+
git push
41+
fi

0 commit comments

Comments
 (0)