-
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.
Merge pull request #6 from whispernorbury/whispernorbury-patch-1
Create main.yml
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI/CD for Comkaraka REST API | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: compose | ||
uses: appleboy/ssh-action@master | ||
with: | ||
username: ${{ secrets.EC2_USER }} | ||
host: ${{ secrets.EC2_HOST }} | ||
key: ${{ secrets.EC2_SSH_PEM_KEY }} | ||
script: | | ||
cd comkaraka-back | ||
sudo docker compose down | ||
sudo docker rm $(sudo docker ps -aq) | ||
sudo docker rmi $(sudo docker images -q) | ||
git pull | ||
sudo docker compose up --build -d |