Skip to content

[CHORE] github action script .env 경로설정 #6

[CHORE] github action script .env 경로설정

[CHORE] github action script .env 경로설정 #6

Workflow file for this run

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
- name: upload .env file at root
uses: actions/upload-artifact@v2
with:
name: .env
path: ./.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