-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub_workflow.yml
More file actions
42 lines (38 loc) · 1.1 KB
/
Copy pathgithub_workflow.yml
File metadata and controls
42 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Deploy Site to Staging
on:
push:
branches:
- staging
env:
ENVIRORMENT: 'staging'
PYTHON_VERSION: '3.10'
SSH_HOST: 'staging.mywebsite.com'
SSH_USER: 'username'
REMOTE_DIRECTORY: 'mywebsite_staging'
jobs:
web-deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v3
- name: Copy files to remote server
uses: garygrossgarten/github-action-scp@release
with:
local: .
remote: ${{ env.REMOTE_DIRECTORY }}
host: ${{ env.SSH_HOST }}
username: ${{ env.SSH_USER }}
privateKey: ${{ secrets.SSH_PRIVATE_KEY}}
rmRemote: true
concurrency: 10
- name: Exceute deployment script
uses: garygrossgarten/github-action-ssh@release
with:
command: |
cd ${{ env.REMOTE_DIRECTORY }}
chmod +x utility/install_django.sh
./utility/install_django.sh
host: ${{ env.SSH_HOST }}
username: ${{ env.SSH_USER }}
privateKey: ${{ secrets.SSH_PRIVATE_KEY}}