DOP-3963: Render only latest version of spec at base spec component (… #1195
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
on: | |
push: | |
branches: | |
- "master" | |
- "integration" | |
concurrency: | |
group: environment-stg-${{ github.ref }} | |
cancel-in-progress: true | |
name: Deploy Staging ECS | |
jobs: | |
deploy-stg: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '18.x' | |
- name: Install Serverless Framework | |
run: npm install -g serverless | |
- name: Serverless AWS authentication | |
run: sls config credentials --provider aws --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
- 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-east-2 | |
- name: login-ecr | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Create ECS Repo | |
run: | | |
cd infrastructure/ecs-repo | |
npm ci | |
sls deploy --stage stg | |
sls deploy --stage dotcomstg | |
sls deploy --stage legacydotcomstg | |
- uses: mr-smithers-excellent/docker-build-push@v5 | |
name: build and push to ECR | |
with: | |
image: docs-worker-pool-stg | |
tags: latest | |
registry: ${{ steps.login-ecr.outputs.registry }} | |
buildArgs: NPM_EMAIL=${{ secrets.NPM_EMAIL }},NPM_BASE_64_AUTH=${{ secrets.NPM_BASE64_AUTH }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
NPM_BASE_64_AUTH: ${{ secrets.NPM_BASE64_AUTH }} | |
NPM_EMAIL: ${{ secrets.NPM_EMAIL }} | |
- uses: mr-smithers-excellent/docker-build-push@v5 | |
name: build and push to ECR DOTCOM | |
with: | |
image: docs-worker-pool-dotcomstg | |
tags: latest | |
registry: ${{ steps.login-ecr.outputs.registry }} | |
buildArgs: NPM_EMAIL=${{ secrets.NPM_EMAIL }},NPM_BASE_64_AUTH=${{ secrets.NPM_BASE64_AUTH }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
NPM_BASE_64_AUTH: ${{ secrets.NPM_BASE64_AUTH }} | |
NPM_EMAIL: ${{ secrets.NPM_EMAIL }} | |
- uses: mr-smithers-excellent/docker-build-push@v5 | |
name: build and push to ECR Legacy DOTCOM | |
with: | |
image: docs-worker-pool-legacydotcomstg | |
tags: latest | |
registry: ${{ steps.login-ecr.outputs.registry }} | |
dockerfile: Dockerfile.legacy | |
buildArgs: NPM_EMAIL=${{ secrets.NPM_EMAIL }},NPM_BASE_64_AUTH=${{ secrets.NPM_BASE64_AUTH }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
NPM_BASE_64_AUTH: ${{ secrets.NPM_BASE64_AUTH }} | |
NPM_EMAIL: ${{ secrets.NPM_EMAIL }} | |
- name: Deploy ECS | |
run: | | |
cd infrastructure/ecs-main | |
npm ci | |
sls deploy --stage stg | |
sls deploy --stage dotcomstg | |
sls deploy --stage legacydotcomstg | |
- name: Deploy Lambdas | |
run: | | |
npm ci | |
sls deploy --stage stg | |
sls deploy --stage dotcomstg | |
sls deploy --stage legacydotcomstg | |
sls prune -n 5 |