Skip to content

Commit

Permalink
setup deploy scripts (#36)
Browse files Browse the repository at this point in the history
* setup deploy scripts

* fix profile name
  • Loading branch information
Dustin Goodman authored Nov 27, 2023
1 parent bcaa5f7 commit dd82c0a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy Serverless Framework

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Configure Node
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'

- name: Install packages
run: npm ci

- name: Create AWS profile
uses: Fooji/create-aws-profile-action@v1
with:
profile: moviesApi
region: us-east-1
key: ${{ secrets.AWS_ACCESS_KEY }}
secret: ${{ secrets.AWS_SECRET_KEY }}

- name: Create .env file for deployment
run: |
touch .env
echo CONTENTFUL_CONTENT_MANAGEMENT_API_TOKEN=${{ secrets.CONTENTFUL_CONTENT_MANAGEMENT_API_TOKEN }} >> .env
echo CONTENTFUL_DELIVERY_API_TOKEN=${{ secrets.CONTENTFUL_DELIVERY_API_TOKEN }} >> .env
echo CONTENTFUL_SPACE_ID=${{ secrets.CONTENTFUL_SPACE_ID }} >> .env
echo CONTENTFUL_ENVIRONMENT=${{ secrets.CONTENTFUL_ENVIRONMENT }} >> .env
cat .env
- name: Deploy
run: npm run deploy --stage production --region us-east-1
1 change: 1 addition & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ plugins:
# The `provider` block defines where your service will be deployed
provider:
name: aws
profile: moviesApi
runtime: nodejs18.x
environment:
CONTENTFUL_SPACE_ID: ${env:CONTENTFUL_SPACE_ID}
Expand Down

0 comments on commit dd82c0a

Please sign in to comment.