mirror of
https://github.com/Sea-Haven-Industries/payments-dashboard.git
synced 2026-09-30 11:13:11 +00:00
69 lines
2.2 KiB
YAML
69 lines
2.2 KiB
YAML
name: Deploy
|
|
|
|
# Lambda zip CD. The org reusable builds the zips, uploads them, and calls
|
|
# update-function-code. Terraform owns the functions and ignores code attributes.
|
|
#
|
|
# push to main -> dev, at github.sha
|
|
# release: published -> prod, at the release tag
|
|
# workflow_dispatch -> chosen environment at a chosen ref
|
|
#
|
|
# Releases are cut by a human with `gh release create vX.Y.Z --target main`.
|
|
# Nothing here creates an HCP run.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- "terraform/**"
|
|
- "docs/**"
|
|
- "*.md"
|
|
- ".github/workflows/ci.yaml"
|
|
- ".github/workflows/labeler.yml"
|
|
- ".github/workflows/dependency-review.yml"
|
|
release:
|
|
types: [published]
|
|
workflow_dispatch:
|
|
inputs:
|
|
environment:
|
|
description: "Target Environment"
|
|
required: true
|
|
type: choice
|
|
options: [dev, prod]
|
|
ref:
|
|
description: "Git ref to build and deploy (tag, branch, or SHA). Empty means the workflow ref."
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
deploy-dev:
|
|
name: Deploy to dev
|
|
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.environment == 'dev')
|
|
uses: Sea-Haven-Industries/.github/.github/workflows/cd-hcp-lambda.yaml@ee5b843ca105422b679c3fdeb9eaa68c6e500a85 # v1.0.20
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
secrets: inherit
|
|
with:
|
|
environment: dev
|
|
ref: ${{ inputs.ref }}
|
|
ssm-prefix: /payments-dashboard/deploy
|
|
function-keys: process_csv,slack_app_home,fetch_boa,expense_receiver,expense_processor
|
|
|
|
deploy-prod:
|
|
name: Deploy to prod
|
|
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.environment == 'prod')
|
|
uses: Sea-Haven-Industries/.github/.github/workflows/cd-hcp-lambda.yaml@ee5b843ca105422b679c3fdeb9eaa68c6e500a85 # v1.0.20
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
secrets: inherit
|
|
with:
|
|
environment: prod
|
|
ref: ${{ github.event.release.tag_name || inputs.ref }}
|
|
ssm-prefix: /payments-dashboard/deploy
|
|
function-keys: process_csv,slack_app_home,fetch_boa,expense_receiver,expense_processor
|
|
ship-gate: true
|