31 lines
778 B
YAML
31 lines
778 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: |
|
|
composer global require deployer/deployer
|
|
export PATH="$HOME/.composer/vendor/bin:$PATH"
|
|
|
|
|
|
- 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
|
|
ssh-keyscan -H caloriethingy.com >> ~/.ssh/known_hosts
|
|
|
|
- name: Deploy
|
|
run: dep deploy calorie |