-
Notifications
You must be signed in to change notification settings - Fork 4
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
096f4b0
commit c2eb700
Showing
3 changed files
with
51 additions
and
2 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,49 @@ | ||
name: Deploy Azure VM | ||
|
||
on: | ||
push: | ||
branches: | ||
- prod | ||
|
||
jobs: | ||
deploy_project: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4.1.7 | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44.5.7 | ||
with: | ||
since_last_remote_commit: true | ||
separator: "," | ||
|
||
- name: Copy files via scp using SSH key | ||
uses: appleboy/scp-action@v0.1.7 | ||
with: | ||
host: ${{ secrets.AZURE_VM_IP_ADDRESS }} | ||
username: ${{ secrets.AZURE_VM_USER }} | ||
key: ${{ secrets.AZURE_VM_SSH_KEY }} | ||
port: ${{ secrets.AZURE_VM_PORT }} | ||
source: "." | ||
target: ${{ github.event.repository.name }} | ||
|
||
build_project: | ||
name: Build | ||
needs: deploy_project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Executing remote SSH commands using SSH key | ||
uses: appleboy/ssh-action@v1.0.3 | ||
with: | ||
host: ${{ secrets.AZURE_VM_IP_ADDRESS }} | ||
username: ${{ secrets.AZURE_VM_USER }} | ||
key: ${{ secrets.AZURE_VM_SSH_KEY }} | ||
port: ${{ secrets.AZURE_VM_PORT }} | ||
script: | | ||
cd ${{ github.event.repository.name }} | ||
source venv/bin/activate | ||
pip install -r requirements.txt | ||
sudo supervisorctl reread | ||
sudo supervisorctl update | ||
sudo supervisorctl restart all |
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