[FEAT] gunicorn 설치 및 실행 도입 #20
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
name: Docker Image CI | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: create .env file at root | |
run: | | |
touch .env | |
echo "${{secrets.ENV}}" >> .env | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag qcard-ai | |
- name: Make zip file | |
run: zip -qq -r ./$GITHUB_SHA.zip . | |
shell: bash | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-region: ap-northeast-2 | |
aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.ACCESS_KEY_SECRET }} | |
- name: Upload to S3 | |
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://${{ secrets.S3_BUCKET_NAME }}/deploy-fastapi/$GITHUB_SHA.zip --source . | |
- name: Code Deploy | |
run: aws deploy create-deployment --application-name ${{ secrets.CODE_DEPLOY_APP_NAME }} | |
--deployment-config-name CodeDeployDefault.OneAtATime | |
--deployment-group-name ${{ secrets.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} | |
--s3-location bucket=${{ secrets.S3_BUCKET_NAME }},bundleType=zip,key=deploy-fastapi/$GITHUB_SHA.zip | |