weekly dashboard 를 node-cron 에서 github action으로 마이그레이션 #56
Workflow file for this run
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: deploy-dev | |
on: | |
push: | |
tags: | |
- pupuri-* | |
jobs: | |
deploy: | |
name: Deploy | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_TAG: ${{ github.run_number }} | |
BUILD_NUMBER: ${{ github.run_number }} | |
ECR_REGISTRY: 405906814034.dkr.ecr.ap-northeast-2.amazonaws.com | |
ECR_REPOSITORY: pupuri-prod/pupuri-bot | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Login to ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Docker Build, tag, and push image to ECR | |
id: build-image | |
run: | | |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG \ | |
--build-arg SLACK_BOT_TOKEN=${{ secrets.SLACK_BOT_TOKEN }} \ | |
--build-arg SLACK_AUTH_TOKEN=${{ secrets.SLACK_AUTH_TOKEN }} \ | |
--build-arg SLACK_ACTIVE_CHANNEL_ID=${{ secrets.SLACK_ACTIVE_CHANNEL_ID }} \ | |
--build-arg SLACK_WATCHER_CHANNEL_ID=${{ secrets.SLACK_WATCHER_CHANNEL_ID }} \ | |
--build-arg GHP_ACCESS_TOKEN=${{ secrets.GHP_ACCESS_TOKEN }} \ | |
. | |
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | |
echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" |