👷 feat: fuzzywuzzy 반영 #23
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: Diareat OCR CI/CD | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
CI: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Docker login | |
uses: docker/[email protected] | |
with: | |
username: synoti21 | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
logout: true | |
- name: Build and push to DockerHub | |
run: | | |
docker build -t diareat_ocr . | |
docker tag diareat_ocr:latest synoti21/diareat_ocr:latest | |
docker push synoti21/diareat_ocr:latest | |
CD: | |
needs: CI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to EC2 / Check bot status | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.EC2_HOST }} | |
username: ${{ secrets.EC2_USERNAME }} | |
key: ${{ secrets.EC2_KEY }} | |
script: | | |
echo "AWS_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }}" > env.list | |
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> env.list | |
echo "REGION_NAME=${{ secrets.REGION_NAME }}" >> env.list | |
echo "BUCKET_NAME=${{ secrets.BUCKET_NAME }}" >> env.list | |
sudo docker pull synoti21/diareat_ocr:latest | |
sudo docker-compose --env-file=env.list up -d ocr | |
sudo docker image prune -f | |