Preparing Your Deployment Credentials
To allow a GitHub Action to deploy your Walrus Site, it needs to be able to sign transactions on your behalf. This requires securely providing it with your private key and the corresponding public address.
You will need to:
-
Export a private key from your Sui Wallet or CLI.
-
Correctly format the key and add it as a
SUI_KEYSTOREsecret in your GitHub repository. -
Add the matching public address as a
SUI_ADDRESSvariable in your GitHub repository.
- Prerequisites
Exporting your private key
It's recommended to use a dedicated Sui address for each GitHub workflow rather than reusing addresses across different projects or purposes. This provides better security isolation and helps avoid gas-coin equivocation issues that can occur when multiple workflows try to use the same gas coins concurrently.
- From Sui CLI
- From Slush wallet
If you wish to use a key you already own, you can find it in the ~/.sui/sui_config/sui.keystore file. This file contains a JSON array of all your keys. To find the address for a specific key, you would need to use the sui keytool unpack "<the base64 key from sui.keystore>" command.
If you'd like to create a new key:
-
Generate a new key by running the following command in your terminal:
$ sui keytool generate ed25519 # Or secp256k1 or secp256r1 -
This command creates a file in your current directory named
<SUI_ADDRESS>.key(for example,0x123...abc.key). The filename is your new Sui address. -
The content of this file is the private key in the
base64WithFlagformat. This is the value you need for theSUI_KEYSTOREsecret. -
You now have both the address (from the filename) for the
SUI_ADDRESSvariable and the key (from the file's content) for theSUI_KEYSTOREsecret.
This method is recommended if you manage your keys through the Slush browser extension.
-
Open your Slush extension and select the account you want to use for deployments. Make sure to copy the corresponding Sui address, as you need it later for the
SUI_ADDRESSvariable. -
Navigate to the account management screen and select Export Private Key.
-
Copy the provided private key (it is in bech32 format, starting with
suiprivkey). -
Use the
sui keytool convert <suiprivkey...>command to transform your key into the required Base64 format. Paste your copied key in place ofsuiprivkey...:$ sui keytool convert `suiprivkey...` -
The command produces an output similar to:
╭────────────────┬──────────────────────────────────────────────────────────────────────────╮
│ bech32WithFlag │ suiprivkey............................................................ │
│ base64WithFlag │ A........................................... │
│ hexWithoutFlag │ ................................................................ │
│ scheme │ ed25519 │
╰────────────────┴──────────────────────────────────────────────────────────────────────────╯Copy the
base64WithFlagvalue. This is what you use for theSUI_KEYSTOREsecret.
Funding your address
Before the GitHub Action can deploy your site, the address you generated needs to be funded with both SUI tokens (for network gas fees) and WAL tokens (for storing your site's data). The method for acquiring these tokens differs between Testnet and Mainnet.
- Testnet Funding
- Mainnet funding
-
Get SUI tokens: Use the official Sui faucet to get free Testnet SUI.
-
Get WAL tokens: Exchange your new Testnet SUI for Testnet WAL at a 1:1 rate by running the
walrus get-walcommand either using thewalrus get-walCLI command or visiting stake-wal.wal.app setting network to Testnet and using the "Get WAL" button.
For a Mainnet deployment, you need to acquire both SUI and WAL tokens from an exchange and transfer them to your deployment address. You can also check Slush Wallet for token swaps to WAL, and on-ramp services. Availability might vary by region.
Adding credentials to GitHub
Now, add the key and address to your GitHub repository.
-
Navigate to your GitHub repository in a web browser.
-
Click on the Settings tab located in the top navigation bar of your repository.
-
In the left sidebar, click Secrets and variables, then select Actions.
-
You see 2 tabs: Secrets and Variables. Start with the Secrets tab.
-
Click the New repository secret button.
-
Name the secret
SUI_KEYSTORE. -
In the Value field, paste the
Base64 Key with Flagyou copied earlier. It must be formatted as a JSON array containing a single string:["AXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"] -
Click Add secret to save it.
cautionMake sure to format the keystore as a JSON array with a single string element, not just the raw key value. Include the square brackets and quotes exactly as shown above.
-
Next, switch to the Variables tab and click New repository variable.
-
Name the variable
SUI_ADDRESS. -
In the Value field, paste the Sui address that corresponds to your private key (for example:
0x123abc...def789). -
Click Add variable to save it.
Never share your private key or commit it to version control. GitHub secrets are encrypted and only accessible to your workflows, but always verify you're adding secrets correctly.
For more information about managing secrets and variables in GitHub Actions, check the official GitHub documentation: