-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
115 changed files
with
2,548 additions
and
1,443 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Docgen | ||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
build: | ||
timeout-minutes: 20 | ||
|
||
name: 'Generate & upload documentation' | ||
runs-on: 'ubuntu-20.04' | ||
continue-on-error: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: 'stable' | ||
|
||
- name: Generate doc | ||
run: | | ||
nim --version | ||
nimble --version | ||
nimble install_pinned | ||
# nim doc can "fail", but the doc is still generated | ||
nim doc --git.url:https://github.com/status-im/nim-libp2p --git.commit:${GITHUB_REF##*/} --outdir:${GITHUB_REF##*/} --project libp2p || true | ||
# check that the folder exists | ||
ls ${GITHUB_REF##*/} | ||
- name: Clone the gh-pages branch | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: status-im/nim-libp2p | ||
ref: gh-pages | ||
path: subdoc | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Commit & push | ||
run: | | ||
cd subdoc | ||
# Delete merged branches doc's | ||
for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do rm -rf $branch; done | ||
# Update / create this branch doc | ||
rm -rf ${GITHUB_REF##*/} | ||
mv ../${GITHUB_REF##*/} . | ||
# Remove .idx files | ||
# NOTE: git also uses idx files in his | ||
# internal folder, hence the `*` instead of `.` | ||
find * -name "*.idx" -delete | ||
git add . | ||
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | ||
git config --global user.name = "${{ github.actor }}" | ||
git commit -a -m "update docs for ${GITHUB_REF##*/}" | ||
git push origin gh-pages |
Oops, something went wrong.