Cookbook Community Meetup - 12pm ET / 5pm GMT every week on Wednesdays



Contributors: Megumiiiiii, Tom Wilson, Luke Cassady-Dorion, Tyler Hall
Last Updated:

Github Action


This guide is for educational purposes only, and you should use to learn options of how you might want to deploy your application. In this guide, we are trusting a 3rd party resource github owned by microsoft to protect our secret information, in their documentation they encrypt secrets in their store using libsodium sealed box, you can find more information about their security practices here.

Github Actions are CI/CD pipelines that allows developers to trigger automated tasks via events generated from the github workflow system. These tasks can be just about anything, in this guide we will show how you can use github actions to deploy your permaweb application to the permaweb using Irys and ArNS.


This guide requires understanding of github actions, and you must have some ArNS Test Tokens, go to for more details.


This guide does not include testing or any other checks you may want to add to your production workflow.

Create deploy script

A deploy script is a script that does the heavy lifting of deploying your application, we will use @irys/sdk and warp-contracts to publish our application and register the newly published application on ArNS.

Install deploy dependencies

npm install --save-dev @irys/sdk
npm install --save-dev warp-contracts
npm install --save-dev arweave

Create deploy.mjs file

import Irys from "@irys/sdk";
import { WarpFactory, defaultCacheOptions } from "warp-contracts";
import Arweave from "arweave";

const DEPLOY_FOLDER = "./dist";
const IRYS_NODE = "";

const jwk = JSON.parse(Buffer.from(process.env.PERMAWEB_KEY, "base64").toString("utf-8"));
const arweave = Arweave.init({ host: "", port: 443, protocol: "https" });
const irys = new Irys({ url: IRYS_NODE, token: "arweave", key: jwk });
const warp = WarpFactory.custom(arweave, defaultCacheOptions, "mainnet").useArweaveGateway().build();

const contract = warp.contract(ANT).connect(jwk);
// upload folder
const result = await irys.uploadFolder(DEPLOY_FOLDER, {
	indexFile: "index.html",

// update ANT
await contract.writeInteraction({
	function: "setRecord",
	subDomain: "@",

console.log("Deployed Cookbook, please wait 20 - 30 minutes for ArNS to update!");

Add script to package.json

Create a new script property called deploy, call the build script, then call node deploy.mjs in the value of the scripts deploy property.


  "scripts": {
    "dev": "vuepress dev src",
    "build": "vuepress build src",
    "deploy": "yarn build && node deploy.mjs"

Create github action

Create a deploy.yml file in the .github/workflows folder, this file instructs github actions to deploy when a push event is triggered on the main branch.

name: publish

            - "main"

        runs-on: ubuntu-latest
            - uses: actions/checkout@v2
            - uses: actions/setup-node@v1
                  node-version: 18.x
            - run: yarn
            - run: yarn deploy
                  KEY: ${{ secrets.PERMAWEB_KEY }}


In the project repo, go to the settings and secrets, add a new secret to the repostiory, this secret will be called PERMAWEB_KEY for this project. The value of the secret should be the base64 encode string of the deployment wallet.

base64 -i wallet.json | pbcopy

In order for this deployment to work, you will need to fund this wallets Irys account, make sure there is some $AR in the wallet you will be using, not much, maybe .5 AR, then use the Irys cli to fund.

irys fund 250000000000 -h -w wallet.json -t arweave


Keep this wallet low on funds and only use it for this project.

🎉 You have setup a github action to completely automate your deploy to permaweb!