Merge pull request #47 from avantifellows/main #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will update the code for the production environment | |
on: | |
push: | |
branches: ["release"] | |
name: Deploy to production | |
jobs: | |
build_and_deploy: | |
name: Deploy | |
environment: | |
name: Production | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: Set up SAM | |
uses: aws-actions/setup-sam@v1 | |
- 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: ap-south-1 | |
- name: Build | |
run: sam build --use-container -t templates/prod.yaml | |
- name: Deploy | |
env: | |
DYNAMODB_URL: ${{ secrets.DYNAMODB_URL }} | |
DYNAMODB_REGION: ${{ secrets.DYNAMODB_REGION }} | |
DYNAMODB_ACCESS_KEY: ${{ secrets.DYNAMODB_ACCESS_KEY }} | |
DYNAMODB_SECRET_KEY: ${{ secrets.DYNAMODB_SECRET_KEY }} | |
FIRESTORE_CREDENTIALS: ${{ secrets.FIRESTORE_CREDENTIALS }} | |
MONGO_AUTH_CREDENTIALS: ${{ secrets.MONGO_AUTH_CREDENTIALS }} | |
run: > | |
sam deploy | |
--stack-name ReportingProduction | |
--s3-bucket reporting-engine-production | |
--no-confirm-changeset | |
--no-fail-on-empty-changeset | |
--region ap-south-1 | |
--capabilities CAPABILITY_IAM | |
--parameter-overrides | |
DynamodbUrl=$DYNAMODB_URL | |
DynamodbRegion=$DYNAMODB_REGION | |
DynamodbAccessKey=$DYNAMODB_ACCESS_KEY | |
DynamodbSecretKey=$DYNAMODB_SECRET_KEY | |
FirestoreCredentials=$FIRESTORE_CREDENTIALS | |
MongoAuthCredentials=$MONGO_AUTH_CREDENTIALS |