Skip to content

Github actions to provision/destroy infrastructure #5

Github actions to provision/destroy infrastructure

Github actions to provision/destroy infrastructure #5

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: node --version
- run: npm ci
- run: npm test
deploy:
needs: build
runs-on: ubuntu-latest
environment: aws/prod
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}
steps:
- uses: actions/checkout@v4
- name: Provision infrastructure
run: |
aws cloudformation deploy \
--template-file infra/aws.yaml \
--stack-name Discord-Bot-Service \
--parameter-overrides Token=${{ secrets.DISCORD_BOT_TOKEN }}
# --capabilities CAPABILITY_IAM