Skip to content

update README

update README #9

name: Deploy API to AWS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
AWS_REGION: eu-west-1
STACK_NAME: musicflow-sam-app
S3_BUCKET: portfolio-on-lambda-2999-v3
steps:
- uses: actions/checkout@v3
- uses: aws-actions/setup-sam@v2
with:
use-installer: true
- 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: ${{env.AWS_REGION}}
- name: Create env file
run: |
touch .env
echo CLIENT_ID=${{ secrets.CLIENT_ID }} >> .env
echo CLIENT_SECRET=${{ secrets.CLIENT_SECRET }} >> .env
cat .env
# Build inside Docker containers
- run: sam build --use-container -t template.yaml
# Prevent prompts and failure when the stack is unchanged
- run: |
sam deploy \
--stack-name ${{env.STACK_NAME}} \
--s3-bucket ${{env.S3_BUCKET}} \
--capabilities CAPABILITY_NAMED_IAM \
--resolve-image-repos \
--no-confirm-changeset \
--no-fail-on-empty-changeset\