Skip to content

Commit

Permalink
env vars; app config
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarman committed Jun 29, 2024
1 parent f2a0be3 commit 744a0e0
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
AWS_CFN_TEMPLATE: template.yml
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_ROLE_ARN: ${{ vars.AWS_ROLE_ARN_DEV }}
ENV_FILE: ${{ secrets.ENV_CI }}

jobs:
build:
name: 'Build'
Expand All @@ -29,6 +35,10 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: 'Create .env File'
run: |
echo "${{ env.ENV_FILE }}" > .env
- name: Build
run: npm run build

Expand All @@ -51,8 +61,12 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: 'Create .env File'
run: |
echo "${{ env.ENV_FILE }}" > .env
- name: Run Unit Tests
run: npm run test.unit
run: npm run test:ci

scan:
name: 'Scan'
Expand All @@ -73,5 +87,34 @@ jobs:
- name: Install Dependencies
run: npm ci

- name: 'Create .env File'
run: |
echo "${{ env.ENV_FILE }}" > .env
- name: Run Linter
run: npm run lint

validate-template:
name: 'Validate CloudFormation Template'

runs-on: ubuntu-latest
timeout-minutes: 3

permissions:
id-token: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}

- name: Validate AWS CloudFormation Template
run: |-
aws cloudformation validate-template \
--template-body file://${{ env.AWS_CFN_TEMPLATE }}

0 comments on commit 744a0e0

Please sign in to comment.