fix(ci): checkout the pushed commit instead of default branch
All checks were successful
CI/CD / lint (push) Successful in 41s
CI/CD / test (push) Successful in 44s
CI/CD / lint (pull_request) Successful in 44s
CI/CD / test (pull_request) Successful in 45s
CI/CD / deploy (push) Has been skipped
CI/CD / deploy (pull_request) Has been skipped
All checks were successful
CI/CD / lint (push) Successful in 41s
CI/CD / test (push) Successful in 44s
CI/CD / lint (pull_request) Successful in 44s
CI/CD / test (pull_request) Successful in 45s
CI/CD / deploy (push) Has been skipped
CI/CD / deploy (pull_request) Has been skipped
- git clone defaulted to main, so dev pushes were tested against main - Now clone + git checkout github.sha - Deploy: restart service via sudo -S with secret password
This commit is contained in:
parent
32513485c3
commit
e32ca9c8fb
1 changed files with 5 additions and 11 deletions
|
|
@ -12,8 +12,8 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone --depth 1 https://omegakubeserv.tail951d2f.ts.net/Omega_Kube/VisionApp.git .
|
||||
git fetch --all
|
||||
git clone https://omegakubeserv.tail951d2f.ts.net/Omega_Kube/VisionApp.git .
|
||||
git checkout "${{ github.sha }}"
|
||||
|
||||
- name: Setup Python
|
||||
run: |
|
||||
|
|
@ -37,7 +37,8 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
run: |
|
||||
git clone --depth 1 https://omegakubeserv.tail951d2f.ts.net/Omega_Kube/VisionApp.git .
|
||||
git clone https://omegakubeserv.tail951d2f.ts.net/Omega_Kube/VisionApp.git .
|
||||
git checkout "${{ github.sha }}"
|
||||
|
||||
- name: Setup Python
|
||||
run: |
|
||||
|
|
@ -66,11 +67,4 @@ jobs:
|
|||
- name: Deploy to production
|
||||
run: |
|
||||
apt-get update && apt-get install -y sshpass openssh-client
|
||||
sshpass -p "${{ secrets.PROD_PASSWORD }}" ssh -o StrictHostKeyChecking=no ${{ secrets.PROD_USER }}@${{ secrets.PROD_HOST }} << 'DEPLOY'
|
||||
cd /home/discord/Bots/VisionApp
|
||||
git pull origin main --rebase
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
sudo systemctl restart vision-studio
|
||||
echo "Deploy OK"
|
||||
DEPLOY
|
||||
sshpass -p "${{ secrets.PROD_PASSWORD }}" ssh -o StrictHostKeyChecking=no ${{ secrets.PROD_USER }}@${{ secrets.PROD_HOST }} "cd /home/discord/Bots/VisionApp && git pull origin main --rebase && source venv/bin/activate && pip install -r requirements.txt && echo '${{ secrets.PROD_PASSWORD }}' | sudo -S systemctl restart vision-studio && echo 'Deploy OK'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue