-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Arrow-air/dodoc
Add dodoc and associated CI/CD actions
- Loading branch information
Showing
6 changed files
with
121 additions
and
6 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,19 @@ | ||
name: Install dependencies | ||
description: "Checkout code and install node dependencies using cache if available" | ||
|
||
inputs: | ||
node-version: | ||
required: true | ||
description: "The node version to use for node setup" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Use Node.js ${{ inputs.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: "npm" | ||
- name: Install dependencies | ||
shell: bash | ||
run: npm ci |
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,55 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, and run hardhat dodoc on Arrow contracts | ||
|
||
name: Generate docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
generate-docs: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
uses: ./.github/actions/install | ||
with: | ||
node-version: 16.x | ||
- name: Run hardhat dodoc | ||
run: npm run dodoc | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
role-to-assume: "${{ secrets.AWS_ROLE_ARN }}" | ||
role-session-name: arrow-contracts-generate-docs | ||
aws-region: "us-east-2" | ||
- name: Sync files to S3 for processing | ||
id: sync_s3 | ||
run: | | ||
FILES_CHANGED=$(aws s3 sync ./docs/ "s3://${{ secrets.AWS_S3_BUCKET }}${{ secrets.AWS_S3_DOCS_DEST_PATH }}" --delete --size-only | wc -l) | ||
echo "::set-output name=files_changed::$FILES_CHANGED" | ||
outputs: | ||
files_changed: "${{ steps.sync_s3.outputs.files_changed }}" | ||
|
||
publish-docs: | ||
runs-on: ubuntu-latest | ||
needs: [generate-docs] | ||
if: needs.generate-docs.outputs.files_changed > 0 | ||
steps: | ||
- name: Info | ||
run: | | ||
echo '::echo::on' | ||
echo "Running action since files_changed is set to: ${{ needs.generate-docs.outputs.files_changed }}" | ||
- name: Dispatch website deploy docs action | ||
uses: peter-evans/repository-dispatch@v2 | ||
with: | ||
repository: Arrow-Air/website | ||
event-type: deploy-docs | ||
token: "${{ secrets.REPO_ACCESS_TOKEN }}" | ||
client-payload: '{"environment": "production"}' |
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