Skip to content

Feat: 외부 weather api 캐싱 어노테이션을 WeatherClientProxy.getWeatherInfo 메서드에… #126

Feat: 외부 weather api 캐싱 어노테이션을 WeatherClientProxy.getWeatherInfo 메서드에…

Feat: 외부 weather api 캐싱 어노테이션을 WeatherClientProxy.getWeatherInfo 메서드에… #126

Workflow file for this run

name: CD
on:
push:
branches:
- main
permissions:
contents: read
jobs:
cd:
runs-on: ubuntu-22.04
env:
IMAGE_TAG: ${{ github.sha }}
REPO: ${{ secrets.DOCKER_REPOSITORY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Execute Gradle build
run: ./gradlew clean :bootBuildImage --imageName=$REPO:$IMAGE_TAG
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish Docker image
run: |
echo "Pushing Docker image with tag: $IMAGE_TAG"
docker push $REPO:$IMAGE_TAG
- name: Send command by AWS SSM
uses: peterkimzz/aws-ssm-send-command@master
id: ssm
with:
aws-region: ap-northeast-2
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
instance-ids: ${{ secrets.AWS_INSTANCE_ID }}
working-directory: ${{ vars.DEPLOY_SCRIPT_PATH }}
command: |
echo "############# PULL DOCKER IMAGE #############"
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
docker pull ${{ env.REPO }}:${{ env.IMAGE_TAG }}
echo "############# RUN DEPLOY SCRIPT #############"
sh deploy.sh ${{ env.REPO }} ${{ env.IMAGE_TAG }}