-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgithub-actions-deploy.yml
More file actions
66 lines (59 loc) · 2.49 KB
/
Copy pathgithub-actions-deploy.yml
File metadata and controls
66 lines (59 loc) · 2.49 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Example consumer workflow: auto-deploy your site/dapp to DIG on every push.
#
# Copy this to `.github/workflows/deploy.yml` in YOUR repo. On every push to your
# default branch it builds your site and publishes a new capsule to your existing
# DIG store — git-push-to-deploy.
#
# ONE-TIME SETUP (on the machine where you created the store with `digstore init`):
# 1. Get the store id: digstore log --json (the "store_id" field)
# 2. Export the deploy key: digstore deploy-key export
# 3. Add two repository SECRETS (Settings → Secrets and variables → Actions):
# DIG_MNEMONIC = your funded DEPLOY wallet's BIP-39 mnemonic
# DIG_DEPLOY_KEY = the 64-hex deploy key from step 2
# 4. Commit a `dig.toml` to your repo root (or pass store-id below):
# store-id = "<your 64-hex store id>"
# output-dir = "dist" # your build output directory
# # build-command = "npm ci && npm run build" # optional
#
# SECURITY: DIG_MNEMONIC can spend ALL of that wallet's DIG/XCH. Use a DEDICATED,
# low-balance deploy wallet funded only with enough $DIG for your expected deploys
# (each deploy costs a uniform per-capsule price in $DIG + a small XCH fee). Scoped,
# spend-capped, revocable deploy tokens (no seed in CI) are the planned secure
# replacement.
name: Deploy to DIG
on:
push:
branches: [main] # your default branch
# One deploy at a time; let the running one finish (it spends on-chain).
concurrency:
group: dig-deploy
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Build your site here (or let the action do it via build-command).
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build
run: |
npm ci
npm run build # produces ./dist
- name: Deploy to DIG
id: dig
uses: DIG-Network/digstore@v0.5.29 # pin to a digstore release tag
with:
mnemonic: ${{ secrets.DIG_MNEMONIC }}
deploy-key: ${{ secrets.DIG_DEPLOY_KEY }}
output-dir: dist
# store-id: "<64-hex>" # omit if set in dig.toml
# build-command: "npm ci && npm run build" # alternative to building above
- name: Show result
run: |
echo "Capsule: ${{ steps.dig.outputs.capsule }}"
echo "Open: ${{ steps.dig.outputs.chia-url }}"
echo "DIGHUb: ${{ steps.dig.outputs.hub-url }}"