Skip to content

Latest commit

Β 

History

History
75 lines (61 loc) Β· 2.77 KB

File metadata and controls

75 lines (61 loc) Β· 2.77 KB

Nx Serverless Deployment

Inputs

Name Required Type Default Description
environment βœ… string The GitHub environment to run in
command ❌ string build Command to run during the deploy step
package-manager ❌ string yarn Node package manager to use
build-command ❌ string build Command to override the build command
debug ❌ boolean false If verbose logging should be enabled
create-backport-pr ❌ boolean false Create a backport PR after deployment
backport-target-branch ❌ string staging Target branch for backport PR

Variables and Secrets

These should be configured in your GitHub Environment (or at the repository level if not using environments).

Name Required Type Description
STAGE βœ… Variable The Stage name to deploy
AWS_ACCESS_KEY_ID βœ… Variable AWS Access Key ID for authentication
AWS_SECRET_ACCESS_KEY βœ… Secret AWS Secret Access Key for authentication
CFN_ROLE βœ… Secret CloudFormation role ARN to assume
AWS_REGION ❌ Variable AWS Region to deploy to (defaults to ap-southeast-2)

Note: Backporting only occurs when deploying from production, main, or master branches. Deployments from other branches are skipped.

Note: If calling this workflow from an external GitHub organisation, you will need to pass the AWS_SECRET_ACCESS_KEY explicitly (see example below).

Example Usage

jobs:
  deploy-serverless:
    uses: aligent/workflows/.github/workflows/nx-serverless-deployment.yml@main
    with:
      environment: development
      debug: true
name: πŸš€ Deploy

on:
  push:
    branches:
      - staging
      - production

jobs:
  deploy:
    uses: aligent/workflows/.github/workflows/nx-serverless-deployment.yml@main
    with:
      environment: ${{ github.ref_name == 'production' && 'Production' || 'Staging' }}
      package-manager: npm
name: πŸš€ Deploy

on:
  push:
    branches:
      - staging
      - production

jobs:
  deploy:
    uses: aligent/workflows/.github/workflows/nx-serverless-deployment.yml@main
    with:
      environment: ${{ github.ref_name == 'production' && 'Production' || 'Staging' }}
      package-manager: npm
    secrets:
      AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}