diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index da8374bc..08299a6d 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -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: @@ -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