main. The workflow makes your Git repository the source of truth: each deploy replaces the project’s code on Intuned with the code on main.
Before you start
- Your Intuned project is at the root of a GitHub repository.
- Your Intuned settings file (
Intuned.jsonorIntuned.jsonc) setsprojectNameandworkspaceId. See the Intuned.json reference. .intuned/is listed in your.gitignore. The CLI writes local checkout information there, and the workflow relies on it not being committed.- You have an Intuned API key. See how to manage API keys.
Set up the workflow
1. Add your API key to GitHub
In your GitHub repository, go to Settings > Secrets and variables > Actions and create a repository secret namedINTUNED_API_KEY with your API key as the value.
2. Add the workflow file
Create.github/workflows/deploy-intuned.yml:
- Triggers: the workflow runs on every push to
main, and you can run it manually from the Actions tab. Theif: github.ref == 'refs/heads/main'check stops a manual run from deploying any other branch. concurrency: only one deploy runs at a time. If several merges land while a deploy is running, GitHub keeps only the newest waiting run, so the latest commit onmainis the one that ends up deployed.INTUNED_CLI_VERSION: pins the CLI so a new release can’t change your pipeline unannounced. Replace0.1.19with the latest version on npm, and bump it deliberately.- Install dependencies:
yarn install --frozen-lockfileanduv sync --lockedfail if your lockfile is out of date withpackage.jsonorpyproject.toml, so dependency problems stop the job before anything is deployed. If your TypeScript project uses npm instead of Yarn, replace the Corepack and install steps withnpm ci. - Typecheck (TypeScript): a type error fails the job before anything is deployed.
- Deploy:
--non-interactiveturns off prompts, and--on-conflict overridemakes the commit replace the project on Intuned. See How the deploy works.
If your settings file doesn’t set
workspaceId, add a repository variable
named INTUNED_WORKSPACE_ID and pass it to the Deploy step with
INTUNED_WORKSPACE_ID: ${{ vars.INTUNED_WORKSPACE_ID }}. See CLI
configuration.3. Run the first deploy
Merge the workflow file tomain, or open the Actions tab, select Deploy to Intuned, and select Run workflow. The Deploy step logs the files it saved and the deployment result. If the project doesn’t exist on Intuned yet, the first deploy creates it.
How the deploy works
intuned dev deploy saves the files to the project on Intuned, then starts a deployment.
- The save replaces the project’s code. The CLI normally compares your files with the version you checked out, which it records in
.intuned/checkout. That file isn’t in the repository, so the workflow has no checkout to compare against. With--on-conflict override, the save replaces the project’s code with the files in the commit, and files on Intuned that aren’t in the commit are removed. - Ignored files aren’t uploaded. The CLI skips files matched by your
.gitignoreand its default exclusions, such asnode_modules/,.env, and.intuned/. - The job waits for the deployment. The Deploy step fails if the deployment fails, or if it’s still pending after 10 minutes.
- Jobs defined in code deploy with the project. Files in
intuned-resources/jobs/create, update, and delete Jobs on each deploy. Jobs created in the dashboard or through the API aren’t affected. See Jobs. - Environment variables aren’t part of the deploy. Keep the values your APIs read at runtime on Intuned. See environment variables and secrets.