forked from labscommunity/arweave-wallet-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): add tool for deploying docs
- Loading branch information
1 parent
77ca6b6
commit f8561cd
Showing
3 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { exec } from 'node:child_process'; | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
|
||
const __dirname = path.dirname(new URL(import.meta.url).pathname); | ||
|
||
const wallet = | ||
process.env.DEPLOY_KEY ?? | ||
fs.readFileSync(path.join(__dirname, 'wallet.json'), 'utf-8').trim(); | ||
const b64EncodedWallet = | ||
process.env.DEPLOY_KEY ?? Buffer.from(wallet).toString('base64'); | ||
|
||
async function main() { | ||
const deployProcess = exec( | ||
`yarn build-storybook && permaweb-deploy --ant-process $DEPLOY_ANT_PROCESS_ID --undername ao-wallet-kit --deploy-folder $DEPLOY_DIR`, | ||
{ | ||
env: { | ||
...process.env, | ||
DEPLOY_KEY: b64EncodedWallet, | ||
DEPLOY_ANT_PROCESS_ID: 'wJVTnZTedI9FIY4r2cB9C4CpAJKImvhu0WjOh0AecjQ', | ||
DEPLOY_DIR: path.join(__dirname, '..', 'storybook-static'), | ||
}, | ||
}, | ||
); | ||
|
||
deployProcess.stdout.pipe(process.stdout); | ||
deployProcess.stderr.pipe(process.stderr); | ||
deployProcess.on('exit', (code) => { | ||
if (code !== 0) { | ||
process.exit(code); | ||
} | ||
}); | ||
} | ||
|
||
main().catch(console.error); |