feat(.github): use non-branch specific cache with deploy #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | ||
on: | ||
workflow_call: | ||
inputs: | ||
stacks: | ||
type: string | ||
default: "**" | ||
environment: | ||
type: string | ||
action: | ||
type: string | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: environment | ||
description: Target environment | ||
action: | ||
type: choice | ||
options: | ||
- deploy | ||
- diff | ||
description: Action to perform | ||
stacks: | ||
type: string | ||
description: Stacks to deploy | ||
default: "**" | ||
concurrency: deploy-${{ github.ref_name }}-${{ inputs.environment }} | ||
env: | ||
TAG: ${{ github.sha }} | ||
jobs: | ||
setup_mise_tools: | ||
uses: ./github/workflows/mise.yml | ||
run: | ||
name: ${{ inputs.action }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
environment: | ||
name: ${{ inputs.environment }} | ||
url: ${{ vars.environment_url }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Log in to ${{ inputs.environment }} | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: eu-west-1 | ||
role-to-assume: arn:aws:iam::${{ vars.account_id }}:role/kitu-github-actions-role | ||
- name: Install dependencies | ||
run: npm ci | ||
working-directory: infra | ||
- name: ${{ inputs.action }} | ||
working-directory: infra | ||
run: | | ||
aws logs start-live-tail --log-group-identifiers arn:aws:logs:eu-west-1:${{ vars.account_id }}:log-group:KituService & | ||
npx cdk ${{ inputs.action }} --require-approval=never --exclusively '${{ inputs.environment }}/${{ inputs.stacks }}' |