Skip to content

Commit

Permalink
feat: setup ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
WFZ1 committed Aug 11, 2024
1 parent 17f261c commit 9a41d9d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy to AWS

on:
push:
branches:
- homework

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: |
cd ./app
npm install
cd ../
cd ./infrastructure
npm install
- name: Build Gatsby app
run: |
cd ./app
npm run build
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: eu-central-1

- name: Deploy by AWS CDK
run: |
cd ./infrastructure
npm install -g aws-cdk
npm run build
cdk bootstrap --require-approval never
cdk synth --require-approval never
cdk deploy --require-approval never

0 comments on commit 9a41d9d

Please sign in to comment.