diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 342a2a6..f60b320 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -57,3 +57,16 @@ jobs: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} docker build -t ${{ secrets.DOCKER_USERNAME }}/petwalk . docker push ${{ secrets.DOCKER_USERNAME }}/petwalk + + - name: Deploy to Instance + uses: appleboy/ssh-action@v1.0.3 #가장 최신 버젼 appleboy 사용 + with: + host: ${{secrets.GCP_HOST}} + username: ${{secrets.GCP_USERNAME}} + key: ${{secrets.GCP_PRIVATEKEY}} + script: | + sudo su + docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + docker pull ${{secrets.DOCKER_USERNAME}}/petwalk + docker run --name petwalk-backend -d -p 8080:8080 helloaway/petwalk + docker image prune -f