casing fix #83
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 public monitor to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| environment: | |
| name: github-pages | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" | |
| - name: Cache pnpm store | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Require reachable HTTPS endpoints for the PWA | |
| env: | |
| PUBLIC_API_ORIGIN: https://api.slashveto.me | |
| MAINNET_L1_RPC_URLS: ${{ vars.VITE_L1_RPC_URL }} | |
| TESTNET_L1_RPC_URLS: ${{ vars.VITE_TESTNET_L1_RPC_URL }} | |
| run: | | |
| require_https_list() { | |
| local name="$1" | |
| local value="$2" | |
| if [[ -z "$value" ]]; then | |
| echo "Set the $name repository variable; Pages must never ship a localhost fallback." | |
| return 1 | |
| fi | |
| local endpoints | |
| IFS=',' read -ra endpoints <<< "$value" | |
| for endpoint in "${endpoints[@]}"; do | |
| endpoint="${endpoint#"${endpoint%%[![:space:]]*}"}" | |
| endpoint="${endpoint%"${endpoint##*[![:space:]]}"}" | |
| if [[ "$endpoint" != https://* ]]; then | |
| echo "$name must contain only HTTPS URLs." | |
| return 1 | |
| fi | |
| done | |
| } | |
| if [[ -z "$PUBLIC_API_ORIGIN" || "$PUBLIC_API_ORIGIN" != https://* || "$PUBLIC_API_ORIGIN" == *,* ]]; then | |
| echo "VITE_API_BASE_URL must be one public HTTPS API origin." | |
| exit 1 | |
| fi | |
| require_https_list VITE_L1_RPC_URL "$MAINNET_L1_RPC_URLS" | |
| require_https_list VITE_TESTNET_L1_RPC_URL "$TESTNET_L1_RPC_URLS" | |
| - name: Lint, test, syntax-check, and build | |
| run: pnpm check | |
| env: | |
| VITE_API_BASE_URL: https://api.slashveto.me | |
| VITE_BASE_PATH: ${{ vars.VITE_BASE_PATH || '/' }} | |
| VITE_L1_RPC_URL: ${{ vars.VITE_L1_RPC_URL }} | |
| VITE_REGISTRY_ADDRESS: ${{ vars.VITE_REGISTRY_ADDRESS }} | |
| VITE_TESTNET_L1_RPC_URL: ${{ vars.VITE_TESTNET_L1_RPC_URL }} | |
| VITE_TESTNET_REGISTRY_ADDRESS: ${{ vars.VITE_TESTNET_REGISTRY_ADDRESS }} | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: './dist' | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |