permaweb-deploy

1.1.7 • Public • Published

Permaweb deployment package

Inspired by the cookbook github action deployment guide, permaweb-deploy is a Node.js command-line tool designed to streamline the deployment of JavaScript bundles to the permaweb using Arweave. It simplifies the process by bundling JS code, deploying it as a transaction to Arweave, and updating ArNS (Arweave Name Service) with the transaction ID.

Features

  • Bundle Deployment: Automatically bundles your JS code and deploys it to Arweave.
  • ArNS Update: Updates ArNS with the new transaction ID each time new content is deployed.
  • Automated Workflow: Integrates with GitHub Actions for continuous deployment directly from your repository.

Installation

Install the package using npm:

npm install permaweb-deploy

Prerequisites

Before using permaweb-deploy, you must:

  1. Encode your Arweave wallet key in base64 format and set it as a GitHub secret:

    base64 -i wallet.json | pbcopy
  2. Ensure that the secret name for the encoded wallet is DEPLOY_KEY.

Usage

To deploy your application, ensure you have a build script and a deployment script in your package.json:

"scripts": {
    "build": "your-build-command",
    "deploy-main": "npm run build && permaweb-deploy --ant-process <ANT_PROCESS>"
}

Replace <ANT_PROCESS> with your actual ANT process.

GitHub Actions Workflow

To automate the deployment, set up a GitHub Actions workflow as follows:

name: publish

on:
  push:
    branches:
      - 'main'

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 20.x
      - run: npm install
      - run: npm run deploy-main
        env:
          DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}

Important Notes

  • Security: Always use a dedicated wallet for deployments to minimize risk.
  • Wallet Key: The wallet must be base64 encoded to be used in the deployment script.
  • ANT Process: The ANT process must be passed at runtime to associate your deployment with a specific ANT process on AO.

Readme

Keywords

none

Package Sidebar

Install

npm i permaweb-deploy

Weekly Downloads

180

Version

1.1.7

License

ISC

Unpacked Size

45 kB

Total Files

9

Last publish

Collaborators

  • nickj202