Deploy Wagmi Integration to GitHub Pages #3
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 Wagmi Integration to GitHub Pages | |
| on: | |
| workflow_call: | |
| inputs: | |
| destination_dir: | |
| required: true | |
| type: string | |
| secrets: | |
| PUBLISH_DOCS_TOKEN: | |
| required: true | |
| workflow_dispatch: | |
| inputs: | |
| destination_dir: | |
| description: 'Destination directory on GitHub Pages (e.g., "latest", "5.0.0", "wagmi")' | |
| required: true | |
| type: string | |
| jobs: | |
| deploy-wagmi-to-gh-pages: | |
| name: Deploy Wagmi Integration to GitHub Pages | |
| runs-on: ubuntu-latest | |
| environment: gh-pages | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Ensure `destination_dir` is not empty | |
| if: ${{ inputs.destination_dir == '' }} | |
| run: exit 1 | |
| - uses: actions/checkout@v4 | |
| - name: Install Corepack via Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Install Yarn | |
| run: corepack enable | |
| - name: Restore Yarn cache | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'yarn' | |
| - name: Install dependencies via Yarn | |
| run: yarn --immutable | |
| - name: Build workspace dependencies | |
| run: | | |
| # Build all packages (workspace dependencies) in topological order | |
| # This ensures @metamask/connect-evm and other dependencies are built first | |
| yarn workspaces foreach --all --topological-dev --verbose --no-private run build | |
| - name: Build wagmi integration | |
| working-directory: integrations/wagmi | |
| run: yarn build | |
| - name: Deploy to `${{ inputs.destination_dir }}` directory of `gh-pages` branch | |
| uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935 | |
| with: | |
| # This `PUBLISH_DOCS_TOKEN` needs to be manually set per-repository. | |
| # Look in the repository settings under "Environments", and set this token in the `github-pages` environment. | |
| personal_token: ${{ secrets.PUBLISH_DOCS_TOKEN }} | |
| publish_dir: ./integrations/wagmi/dist | |
| destination_dir: ${{ inputs.destination_dir }} |