Merge pull request #28 from jwpark1211/develop #22
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: Backend CD | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: WAS 인스턴스 접속 및 애플리케이션 실행 | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.AWS_IP }} | |
username: ubuntu | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
script: | | |
sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | |
sudo docker stop $(docker ps -a -q) | |
sudo docker rm $(docker ps -a -q) | |
sudo docker pull ${{ secrets.DOCKER_REPOSITORY }} | |
sudo docker run -d -p 8080:8080 --name new ${{ secrets.DOCKER_REPOSITORY }} |