Update issue templates #6
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: Build and Push to ECR and Deploy cache | |
on: | |
push: | |
paths-ignore: | |
- 's3/**' | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Set up AWS CLI | |
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 }} # AWS 리전 설정 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build Docker Image | |
run: | | |
docker build --build-arg AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} --build-arg AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} --build-arg AWS_REGION_NAME_NAME=${{ secrets.AWS_REGION_NAME }} -t ssudobi-cache:latest . | |
docker tag ssudobi-cache:latest ${{secrets.AWS_ACCOUNTID}}.dkr.ecr.${{secrets.AWS_REGION_NAME}}.amazonaws.com/lambda_ssudobi_cache:latest | |
- name: Push Docker Image to ECR | |
run: | | |
docker push ${{secrets.AWS_ACCOUNTID}}.dkr.ecr.${{secrets.AWS_REGION_NAME}}.amazonaws.com/lambda_ssudobi_cache:latest | |
- name: Deploy ssudobi-cache function | |
run: | | |
aws lambda update-function-code --function-name ssudobi_cache --image-uri ${{secrets.AWS_ACCOUNTID}}.dkr.ecr.${{secrets.AWS_REGION_NAME}}.amazonaws.com/lambda_ssudobi_cache:latest |