workflows 폴더 및 파일 추가 #1
Workflow file for this run
This file contains hidden or 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: Deploy Playwright Crawler to ECR | |
| on: | |
| push: | |
| branches: | |
| - playwright-crawler | |
| env: | |
| AWS_REGION: ap-northeast-2 | |
| ECR_REPOSITORY: playwright-news-crawler | |
| IMAGE_TAG: dev | |
| AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Amazon ECR | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| - name: Build Docker image from subdirectory | |
| working-directory: playwright_news_crawler | |
| run: | | |
| docker build --platform linux/amd64 -t $ECR_REPOSITORY:$IMAGE_TAG . | |
| - name: Tag image for ECR | |
| run: | | |
| docker tag $ECR_REPOSITORY:$IMAGE_TAG \ | |
| $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$IMAGE_TAG | |
| - name: Push image to ECR | |
| run: | | |
| docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$ECR_REPOSITORY:$IMAGE_TAG | |
| - name: Notify success | |
| run: | | |
| echo "[Success] pushed image to ECR: $ECR_REPOSITORY:$IMAGE_TAG" |