refactor: defer helper side effects until setup access (#1071) #873
This file contains hidden or 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: | |
| push: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: write | |
| id-token: write | |
| pages: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: Load cached Poetry installation | |
| id: cached-poetry | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.local # the path depends on the OS | |
| key: poetry-${{ runner.os }}-3.10-0 # increment to reset cache | |
| - name: Install Poetry | |
| if: steps.cached-poetry.outputs.cache-hit != 'true' | |
| uses: snok/install-poetry@v1 | |
| - name: Install Dependencies | |
| run: | | |
| poetry install --no-interaction | |
| - name: Install dependencies | |
| # pip will install despite the conflicts, poetry will prevent it | |
| run: | | |
| poetry run pip install setuptools wheel | |
| poetry run pip install --no-build-isolation "Cython<3" "pyyaml==5.4.1" | |
| poetry run pip install sphinx sphinx-rtd-theme | |
| - name: Setup brownie networks | |
| run: | | |
| poetry run brownie networks modify mainnet host=${{ secrets.ALCHEMY_PROVIDER }} | |
| continue-on-error: true | |
| - name: Build documentation config | |
| run: | | |
| make docs | |
| - name: Build documentation | |
| run: | | |
| cd docs | |
| BROWNIE_NETWORK_ID=mainnet make html | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs/_build/html | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: gh-pages | |
| persist-credentials: false | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| # Upload entire repository | |
| path: '.' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |