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