Nitric is an open source framework for developing cloud applications in your language of choice and then easily deploying with auto-provisioned infrastructure in AWS, Azure or Google Cloud.
With Nitric’s GitHub Action, you can automate your cloud deployment of your application with the right cloud-native infrastructure, so that each commit to your GitHub repo triggers a deployment to the stack you’ve configured.
Note: This action is designed to be run on ubuntu-latest due to limitations on
MacOS runners and Windows VMs. It ensures the installation and exposure of a
specified version of the Nitric CLI on the GitHub Actions runner environment.
name: Nitricon:
push:
branches:
- mainjobs:
up:
name: Updateruns-on: ubuntu-lateststeps:
- name: Checkout 🛎️uses: actions/checkout@v4
- name: Install and configure Pulumi 📦uses: pulumi/actions@v4
- name: Applying infrastructure 🚀uses: nitrictech/actions@v1with:
command: upstack-name: dev # replace with your stackenv:
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}This will check out the existing directory and run nitric up.
The actions supports the following inputs:
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
version | String | Nitric CLI version (or latest) | latest | false |
command | String | The command to run as part of the action. Accepted values are up and down. If unspecified, the action will stop after installing Nitric. | false | |
stack-name | String | The name of the stack that Nitric will be operating on. The stack file should be located in the working directory. | When command is specified | |
working-directory | String | Working directory containing Nitric stack. Useful for mono-repos. | false |
If you want to only install the Nitric CLI, omit the command field of the
action.
- uses: nitrictech/actions@v1A specific version of the Nitric CLI can be installed:
steps:
- uses: nitrictech/actions@v1with:
version: 1.34.4Below are some example workflows:
Install the dependencies
npm installBuild the typescript and package it for distribution
npm run packageRun the tests
npm testTo publish the action, we use JasonEtco/build-and-tag-action. This automates the build and tagging process.
npm run allTo learn more about Nitric, check out the docs at https://nitric.io/docs, including resources for getting started and a step-by-step guide for setting up continuous deployment with GitHub Actions.
For questions and support, please get in touch through GitHub Discussions or Discord.