davemooreuws / setup-nitric

Make nitric available for GitHub actions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nitric CLI Action

This action sets up the Nitric CLI on GitHub's hosted Actions runners.

Nitric's GitHub Setup exposes the Nitric CLI to your GitHub workflow so that you can run any command you wish using actions.

Run this action on ubuntu-latest since the MacOS runner lacks Docker and Windows VMs have depth limitations. The action installs and exposes the specified version of the Nitric CLI on the runner environment.

Usage

Setup the Nitric CLI:

steps:
  - uses: nitrictech/setup-nitric@v1

A specific version of the Nitric CLI can be installed:

steps:
  - uses: nitrictech/setup-nitric@v1
    with:
      version: 1.33.3

Run nitric up to deploy a stack named dev to AWS:

steps:
  - uses: nitrictech/setup-nitric@v1
    with:
      version: latest
  - run: nitric up -s dev --ci

Inputs

version:
  description: Version of the CLI being used
  required: false
  default: 1.2.1

Example workflow

name: Sample configuration to deploy to AWS
on:
  workflow_dispatch:
  push:
    branches:
      - main
env:
  PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
  PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
jobs:
  update:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-region: ${{ secrets.AWS_REGION }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      - name: Install Nitric CLI
        uses: nitrictech/setup-nitric@v1
        with:
          version: 1.2.1
      - name: Install dependencies
        uses: pulumi/setup-pulumi@v2
      - name: Checkout project
        uses: actions/checkout@v3
      - name: Resolve packages
        run: npm install
      - name: Deploy stack to aws
        run: nitric up -s dev -v0

Develop

To update your changes, rebuild the dist folder with the following command -

npm run build

About

Make nitric available for GitHub actions

License:Apache License 2.0


Languages

Language:TypeScript 100.0%