Skip to content

Commit

Permalink
adding in deploy to aws
Browse files Browse the repository at this point in the history
  • Loading branch information
HeyGarrison committed Sep 30, 2024
1 parent d453324 commit 9066c55
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: AWS Deploy

# on:
# push:
# branches:
# - main

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- 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: us-west-2 # Best region according to AWS
- name: install & run
env:
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
run: |
make build
make deploy-aws
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ localstack-reset:
@echo "Resetting LocalStack..."
@localstack state reset

deploy-aws:
@echo "Deploying apps with Terraform to AWS..."
@cd ./apps/server/.output/server && zip -r ./lambda.zip . && cd -
@cp ./apps/server/.output/server/lambda.zip ./.iac/terraform
@terraform -chdir=./.iac/terraform init
@terraform -chdir=./.iac/terraform apply --auto-approve

localstack-deploy-terraform:
@echo "Locally deploying apps with Terraform..."
@localstack wait
Expand Down

0 comments on commit 9066c55

Please sign in to comment.