Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy

# main goes to testnet, a release tag to mainnet. Anything to deploy has passed
# CI on its pull request.
# main goes to testnet and devnet, a release tag to mainnet. Anything to deploy
# has passed CI on its pull request.
on:
push:
branches: [main]
Expand All @@ -16,7 +16,7 @@ concurrency:

jobs:
deploy:
name: Deploy to ${{ github.ref_type == 'tag' && 'mainnet' || 'testnet' }}
name: Deploy to ${{ github.ref_type == 'tag' && 'mainnet' || 'testnet and devnet' }}
# GitHub-hosted, for a clean machine around the Cloudflare token.
runs-on: ubuntu-latest
# The token is this environment's, which only main and release tags can use.
Expand Down Expand Up @@ -55,8 +55,11 @@ jobs:
VITE_FEATURE_BLOB_HASHES: "true"

- name: Deploying to Cloudflare
run: deploy/node_modules/.bin/wrangler deploy --env "$NETWORK"
run: |
for network in $NETWORKS; do
deploy/node_modules/.bin/wrangler deploy --env "$network"
done
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
NETWORK: ${{ github.ref_type == 'tag' && 'mainnet' || 'testnet' }}
NETWORKS: ${{ github.ref_type == 'tag' && 'mainnet' || 'testnet devnet' }}
WRANGLER_SEND_METRICS: "false"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ The application will determine which network it is connected to by the subdomain

## Deploying

The explorer runs on Cloudflare (`wrangler.jsonc`), at `explorer.dusk.network` and `explorer.testnet.dusk.network`. It picks its node by hostname, so one build serves both.
The explorer runs on Cloudflare (`wrangler.jsonc`), at `explorer.dusk.network`, `explorer.testnet.dusk.network` and `explorer.devnet.dusk.network`. It picks its node by hostname, so one build serves them all.

The Deploy workflow does it: every merge to `main` goes to testnet, and an `explorer-v*` tag goes to mainnet. Its Cloudflare token is a secret of the `cloudflare` environment, which only `main` and those tags can use.
The Deploy workflow does it: every merge to `main` goes to testnet and devnet, and an `explorer-v*` tag goes to mainnet. Its Cloudflare token is a secret of the `cloudflare` environment, which only `main` and those tags can use.
6 changes: 6 additions & 0 deletions wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"not_found_handling": "404-page",
},
"env": {
"devnet": {
"name": "explorer-devnet",
"routes": [
{ "pattern": "explorer.devnet.dusk.network", "custom_domain": true },
],
},
"testnet": {
"name": "explorer-testnet",
"routes": [
Expand Down
Loading