30 lines
741 B
YAML
30 lines
741 B
YAML
name: Deploy to Production
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
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 |