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

- 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:
Mathis 2026-09-19 15:34:42 +02:00
parent 32513485c3
commit e32ca9c8fb

View file

@ -12,8 +12,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
run: | 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 fetch --all git checkout "${{ github.sha }}"
- name: Setup Python - name: Setup Python
run: | run: |
@ -37,7 +37,8 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
run: | 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 - name: Setup Python
run: | run: |
@ -66,11 +67,4 @@ jobs:
- name: Deploy to production - name: Deploy to production
run: | run: |
apt-get update && apt-get install -y sshpass openssh-client 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' 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'"
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