-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor deployment workflow and update dependencies
- Loading branch information
1 parent
7ea6c4e
commit e22587f
Showing
3 changed files
with
54 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
name: Deploy to EC2 | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build and Push Docker Image"] | ||
types: | ||
- completed | ||
workflow_run: | ||
workflows: ["Build and Push Docker Image"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Deploy to Droplet | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SERVER_IP }} | ||
username: ${{ secrets.SERVER_USER }} | ||
password: ${{ secrets.SERVER_PWD }} | ||
script: | | ||
docker pull abdealijaroli/jaro:latest | ||
docker stop jaro || true | ||
docker rm jaro || true | ||
docker run -d --name jaro -e DB_URL="${{ secrets.DB_URL }}" -p 8008:8008 abdealijaroli/jaro:latest | ||
- name: Deploy to server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SERVER_IP }} | ||
username: ${{ secrets.SERVER_USER }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
script: | | ||
docker pull abdealijaroli/jaro:latest | ||
docker stop jaro || true | ||
docker rm jaro || true | ||
docker run -d --name jaro -e DB_URL="${{ secrets.DB_URL }}" -p 8008:8008 abdealijaroli/jaro:latest |
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
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