Skip to content

Adds deploy scripts. Close #19 #1

Adds deploy scripts. Close #19

Adds deploy scripts. Close #19 #1

Workflow file for this run

name: Build and deploy to production
on:
push:
branches: [production]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "latest"
- run: npm ci
- run: npm run build
- name: Commit built assets
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout -B deploy
git add -f public/
git commit -m "Build front-end assets"
git push -f origin deploy
- name: Deploy to production
uses: appleboy/ssh-action@master
with:
username: ${{ secrets.SSH_USERNAME }}
host: ${{ secrets.SSH_HOST }}
key: ${{ secrets.SSH_KEY }}
script: "cd /var/www/billify && ./server_deploy.sh"