Update .gitea/workflows/deploy.yml
Some checks failed
Deploy to Production / deploy (push) Failing after 1m15s

This commit is contained in:
2025-10-06 13:05:52 -05:00
parent dfd36f8299
commit a7184c401c

View File

@@ -2,30 +2,29 @@ name: Deploy to Production
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy to prod server
uses: appleboy/ssh-action@v0.1.5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
request_pty: true
script: |
# Clone repo if it doesn't exist
if [ ! -d "/var/www/caloriethingy.com/.git" ]; then
rm -rf /var/www/caloriethingy.com
git clone https://git.sometimescode.com/cgsmith/caloriethingy.com.git /var/www/caloriethingy.com
fi
cd /var/www/caloriethingy.com
git pull origin main
composer install --no-dev --optimize-autoloader
php init --env=Production --overwrite=n
php yii migrate
sudo systemctl restart calorie
sudo chown -R www-data:www-data .
php-version: '8.2'
- name: Install Deployer
run: |
curl -LO https://deployer.org/deployer.phar
chmod +x deployer.phar
sudo mv deployer.phar /usr/local/bin/dep
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H ${{ secrets.HOST }} >> ~/.ssh/known_hosts
- name: Deploy
run: dep deploy calorie