Deploy documentation #1
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
name: Deploy documentation | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- main | |
paths: | |
- pkg/** | |
- README.md | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Foundry toolchain | |
run: | | |
curl -OL https://github.com/foundry-rs/foundry/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz | |
tar -xzf foundry_nightly_linux_amd64.tar.gz | |
sudo mv forge /usr/local/bin | |
- name: Generate documentation | |
run: | | |
forge doc -b | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} | |
# update | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
# update | |
projectName: ${{ secrets.CLOUDFLARE_DOCS_PROJECT_NAME }} | |
directory: . | |
# to enable Github Deployments | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
workingDirectory: docs/book |