-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build and push evm contract docs to github pages (#211)
Co-authored-by: Milap Sheth <milap@interoplabs.io>
- Loading branch information
1 parent
432449d
commit aab7a4e
Showing
8 changed files
with
208 additions
and
24 deletions.
There are no files selected for viewing
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,54 @@ | ||
name: "Upload Docs" | ||
|
||
description: "Build and upload docs to GitHub Pages" | ||
inputs: | ||
branches: | ||
description: "Branches to trigger the workflow on" | ||
required: false | ||
default: "main" | ||
environment_name: | ||
description: "Name of the deployment environment" | ||
required: false | ||
default: "github-pages" | ||
script: | ||
description: 'The script to run for generating documentation' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Create docs directory | ||
run: mkdir -p docs | ||
shell: bash | ||
|
||
- name: Build Solidity documentation | ||
run: npx hardhat docgen | ||
shell: bash | ||
|
||
- name: Generate Overview Documentation | ||
run: node ${{ inputs.script }} | ||
shell: bash | ||
|
||
- name: Verify docs directory is not empty | ||
run: | | ||
if [ ! -d "docs" ] || [ ! -s "docs/index.md" ]; then | ||
echo "Docs directory is empty or does not exist" | ||
exit 1 | ||
fi | ||
shell: bash | ||
|
||
- name: Add YAML front matter for Jekyll | ||
run: | | ||
find docs -name '*.md' -exec sh -c 'sed -i.bak "1s/^/---\nlayout: default\n---\n/" "$0" && rm "$0.bak"' {} \; | ||
shell: bash | ||
|
||
- name: Setup Github Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./docs | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 |
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,42 @@ | ||
name: Upload Contract Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
upload-docs: | ||
runs-on: blacksmith-2vcpu-ubuntu-2204 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup tools | ||
uses: ./.github/actions/setup-tools | ||
with: | ||
install-nodejs: 'true' | ||
|
||
- name: Run Upload Docs Action | ||
uses: axelarnetwork/axelar-gmp-sdk-solidity/.github/actions/upload-docs@main | ||
with: | ||
branches: main | ||
environment_name: github-pages | ||
script: scripts/generateOverviewDocs.js | ||
|
||
deploy: | ||
needs: upload-docs | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: blacksmith-2vcpu-ubuntu-2204 | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.