Juno’s latest update to GitHub Actions is making life easier for developers working on decentralised apps. The introduction of new CLI commands means setting up configurations is quicker, and improved best practices are in place to ensure smoother deployments. With a more streamlined process, deploying apps to Juno satellites is now more efficient and secure.
Automation is at the heart of these updates. Before implementing it, developers need to add a secret token to their GitHub repository or organisation, granting permission for the CI to deploy to their satellite. The process involves generating a new controller in Juno’s console, ensuring that the permission scope is limited to ‘Read-write’ to prevent GitHub from having control over smart contracts. The generated token is then saved as an encrypted secret under the key JUNO_TOKEN.
For those starting fresh, setting up a configuration file is essential. A simple command, npx juno init --minimal
, generates the required file, which can be written in TypeScript, JavaScript, or JSON. The file must include a satellite ID, which uniquely identifies the project, and a source directory containing the built assets. Depending on the framework being used, the output folder varies—Next.js projects, for instance, rely on the ‘out’ directory, while Angular projects use dist/<your-project-name>/browser
.
With the configuration set, the next step is to create a GitHub Action. A new YAML file named deploy.yaml
is added to the .github/workflows
subfolder. This file outlines the process GitHub follows when deploying updates. Every time code is pushed to the main branch, the system checks out the repository, installs dependencies, and uses junobuild/juno-action
to build and deploy the application. If a predeploy
field isn’t included in the configuration file, an additional step is required to ensure the application is built before deployment.
Efficiency is key when working with Juno satellites. The system is designed to deploy only new resources by comparing SHA-256 hashes, ensuring that unchanged files aren’t unnecessarily redeployed. While frequent updates keep a project up to date, they can increase costs, as each deployment consumes cycles. To optimise expenses, triggering deployments on releases instead of every commit may be a better approach.
Juno’s enhancements to GitHub Actions simplify workflows while maintaining security and efficiency. By reducing manual setup steps and improving deployment processes, developers can focus more on building their decentralised apps rather than wrestling with infrastructure. The new CLI commands, best practices, and automated processes make a compelling case for integrating these updates into ongoing projects.