Socket
Book a DemoInstallSign in
Socket

@rosmcmahon/permaweb-deploy

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rosmcmahon/permaweb-deploy

Permaweb app deployment package

latest
Source
npmnpm
Version
1.1.10
Version published
Maintainers
0
Created
Source

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:

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

    base64 -i wallet.json | pbcopy
    
  • 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 }}

To deploy to permaweb manually via cli

DEPLOY_KEY=$(base64 -i wallet.json) npx permaweb-deploy --ant-process <ANT_PROCESS>

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.

FAQs

Package last updated on 01 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts