Skip to content

Commit

Permalink
ci: dockerrun 파일 생성 후 s3에 저장
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoiWonYu committed Jun 25, 2024
1 parent fb4ecb7 commit de9cad9
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:
env:
ECR_REGISTRY: ${{ secrets.AWS_ECR_REGISTRY }}
ECR_REPOSITORY: ${{ secrets.AWS_DEV_ECR_REPOSITORY }}
AWS_S3_BUCKET: ${{ secrets.AWS_DEV_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}

jobs:
build_and_push:
Expand Down Expand Up @@ -56,3 +54,26 @@ jobs:
docker build -t $ECR_REPOSITORY:latest .
docker tag $ECR_REPOSITORY:latest $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
- name: Create Dockerrun.aws.json file
run: |
echo '{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "'$ECR_REGISTRY'/'$ECR_REPOSITORY':latest",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "8080"
}
]
}' > Dockerrun.aws.json
- name: Upload Dockerrun.aws.json to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ap-northeast-2
run: |
aws s3 cp Dockerrun.aws.json $AWS_S3_BUCKET/Dockerrun-${{ github.sha }}.aws.json

0 comments on commit de9cad9

Please sign in to comment.