forked from RaoFoundation/subtensor
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (44 loc) · 1.7 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
51 lines (44 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Deploy Docs
# Every website change on main deploys to Vercel and is aliased to the
# staging subdomain. Production promotion happens in watch-mainnet-release.yml
# once a runtime release executes on chain.
on:
push:
branches: [main]
paths:
- "docs/**"
- "website/**"
workflow_dispatch:
concurrency:
group: deploy-docs
cancel-in-progress: true
jobs:
deploy:
name: Deploy staging docs to Vercel
runs-on: [self-hosted, fireactions-turbo-8]
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_DOCS_PROJECT_ID }}
# e.g. bittensor.com; the deployment is aliased to staging.<domain>
DOCS_DOMAIN: ${{ vars.DOCS_DOMAIN || 'bittensor.com' }}
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Enable corepack (yarn 4)
run: corepack enable
- name: Build and deploy
# Run from the repo root: the Vercel project's root directory is
# website/apps/bittensor-website relative to the repo root, and the
# CLI resolves it against the cwd (running from website/ doubles the
# path and fails with ENOENT).
run: |
npx --yes vercel pull --yes --environment=preview --token "$VERCEL_TOKEN"
npx --yes vercel build --token "$VERCEL_TOKEN"
url=$(npx --yes vercel deploy --prebuilt --token "$VERCEL_TOKEN")
echo "Deployed: $url"
npx --yes vercel alias set "$url" "staging.$DOCS_DOMAIN" --token "$VERCEL_TOKEN"
echo "Aliased to https://staging.$DOCS_DOMAIN" >> $GITHUB_STEP_SUMMARY