Introducing ic-deploy-actions – Automate ICP Deployments with Ease

Hi everyone,

I’ve been working on a tool to make ICP deployments smoother and faster, especially in CI/CD pipelines. Today I’m excited to share ic-deploy-actions v0.1.0, a GitHub Action that lets you automate the deployment of your backend canisters and frontend assets in just a few lines.

:link: GitHub Repo: github.com/Stephen-Kimoi/ic-deploy-action


Features

  • :locked_with_key: Secure authentication using PEM keys
  • :globe_with_meridians: Deploy to local, testnet, or mainnet
  • :rocket: Deploy specific canisters or all at once
  • :artist_palette: Optional frontend asset deployment
  • :high_voltage: Fast and reliable CI/CD integration
  • :counterclockwise_arrows_button: Upgrade mode for existing canisters
  • :package: Automatic WASM file detection and upload

:hammer_and_wrench: Quick Usage

1. Install via GitHub Actions

Create a .github/workflows/deploy.yml:

name: Deploy to IC

on:
  push:
    branches: [ main ]
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Deploy to IC
        uses: Stephen-Kimoi/ic-deploy-action/action@v0.1.0
        with:
          pem_key: ${{ secrets.IC_PEM_KEY }}
          network: 'ic'
          canister_name: 'your_backend_canister_name'
          deploy_frontend: 'true'
          frontend_dir: 'src/your_frontend_dir/dist'
          backend_package: 'your_backend_package'
          frontend_package: 'your_frontend_package'
          frontend_src_dir: 'src/your_frontend_dir'

2. Generate a PEM key and add to GitHub Secrets

dfx identity new test-identity --storage-mode=plaintext
dfx identity export test-identity > test-identity.pem
base64 -i test-identity.pem > test-identity.pem.base64

Add the base64 content to your repo secrets as IC_PEM_KEY.


:file_folder: Recommended Project Structure

your-project/
├── src/
│   └── backend/                  # Backend Rust canister source
│   └── frontend/                 # Frontend source (if any)
│       └── dist/                 # Built frontend assets
├── dfx.json                      # DFINITY project configuration
├── canister_ids.json             # Canister IDs (generated after deployment)
├── Cargo.toml                    # Rust package manifest (for backend)
├── package.json                  # Node.js manifest (for frontend, if any)
├── tsconfig.json                 # TypeScript config (if any)
├── node_modules/                 # Node.js dependencies (if any)
└── ... 

Example: Backend Only Deployment
- name: Deploy to IC
  uses: Stephen-Kimoi/ic-deploy-action/action@v0.1.0
  with:
    pem_key: ${{ secrets.IC_PEM_KEY }}
    network: 'ic'
    canister_name: 'your_backend_canister_name'
    deploy_frontend: 'false'
    backend_package: 'your_backend_package'
Example: Frontend Only Deployment
- name: Deploy to IC
  uses: Stephen-Kimoi/ic-deploy-action/action@v0.1.0
  with:
    pem_key: ${{ secrets.IC_PEM_KEY }}
    network: 'ic'
    deploy_frontend: 'true'
    frontend_dir: 'src/your_frontend_dir/dist'
    backend_package: 'your_frontend_package'
    frontend_package: 'your_frontend_package'
    frontend_src_dir: 'src/your_frontend_dir'

:locked: Security Notes

  • Your PEM key is only used during deployment and should always be stored as a GitHub secret.
  • The action does not create canisters — it only upgrades existing ones.

:handshake: Contributing

PRs and suggestions are welcome, especially if you’re using different project structures or CI workflows.


Let me know what you think! Hope this saves you time deploying to the IC :raising_hands:


Full documentation and repo can be found here

5 Likes