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.
GitHub Repo: github.com/Stephen-Kimoi/ic-deploy-action
Features
Secure authentication using PEM keys
Deploy to local, testnet, or mainnet
Deploy specific canisters or all at once
Optional frontend asset deployment
Fast and reliable CI/CD integration
Upgrade mode for existing canisters
Automatic WASM file detection and upload
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
.
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'
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.
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
Full documentation and repo can be found here