-
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.
- Loading branch information
1 parent
e4460ff
commit 4cbb76b
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,36 @@ | ||
name: Deploy to Remote Server | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code 🔍 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install SSH Key 🔐 | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
known_hosts: 'just-a-placeholder-so-we-dont-get-errors' | ||
|
||
- name: Add known_hosts 🖥️ | ||
run: ssh-keyscan -H ${{ secrets.SERVER_IP }} >> ~/.ssh/known_hosts | ||
|
||
- name: Upload with rsync 🔁 | ||
run: rsync --delete -avz --exclude=".git" --exclude=".github" ./ {{secrets.SERVER_USER}}@${{ secrets.SERVER_IP }}:/bacaku | ||
|
||
# Execute command ke VPS | ||
- name: Execute Command ☣️ | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SERVER_IP }} | ||
username: ${{ secrets.SERVER_USER }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
port: ${{ secrets.SERVER_PORT }} | ||
script: | | ||
python3 --version |
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 |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
ALLOWED_HOSTS = [ | ||
'localhost', | ||
'127.0.0.1', | ||
'193.111.124.179', | ||
] | ||
|
||
# Application definition | ||
|
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,41 @@ | ||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} | ||
|
||
server { | ||
listen 80; | ||
listen [::]:80; | ||
|
||
server_name 193.111.124.179; | ||
|
||
gzip on; | ||
|
||
gzip_types | ||
text/css | ||
text/plain | ||
text/javascript | ||
application/javascript | ||
application/json | ||
application/x-javascript | ||
application/xml | ||
application/xml+rss | ||
application/xhtml+xml | ||
application/x-font-ttf | ||
application/x-font-opentype | ||
application/vnd.ms-fontobject | ||
image/svg+xml | ||
image/x-icon | ||
application/rss+xml; | ||
gzip_proxied no-cache no-store private expired auth; | ||
gzip_min_length 1024; | ||
gzip_comp_level 2; | ||
gzip_buffers 32 8k; | ||
|
||
location / { | ||
proxy_pass http://localhost:8000; | ||
proxy_http_version 1.1; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
} | ||
} |