Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
berviantoleo authored Oct 19, 2023
1 parent 72dcf01 commit 20e2652
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ on:
push:
branches: [ main ]
jobs:
deploy:
deploy-image:
# Ensure test job passes before pushing image.
runs-on: ubuntu-22.04
environment: production
permissions:
id-token: write # This is required for requesting the JWT
contents: read
Expand Down Expand Up @@ -52,11 +51,37 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
deploy-apprunner:
runs-on: ubuntu-22.04
environment: production
needs: deploy-image
permissions:
id-token: write # This is required for requesting the JWT
contents: read
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4 # More information on this action can be found below in the 'AWS Credentials' section
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ secrets.AWS_ROLE_SESSION_NAME }}
aws-region: 'ap-southeast-1'
- name: Install CDK
run: |
npm install -g aws-cdk
cdk doctor
- name: Prepare App Runner
uses: bervProject/prepare-apprunner-action@0.1.3
with:
arn: ${{ secrets.ARN }}
region: 'ap-southeast-1'
- name: Deploy Infra
working-directory: 'infra'
run: |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cdk deploy TelegramBotInfraStack --parameters "imageTag=sha-${{ github.sha }}" --require-approval never
npm install
cdk deploy TmeStack --parameters "imageTag=sha-${{ github.sha }}" --require-approval never

0 comments on commit 20e2652

Please sign in to comment.