Skip to content

- add extra jobs

- add extra jobs #28

Workflow file for this run

name: Deploy
on:
push:
branches: [ main ]
jobs:
build:
name: Build binary file
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Build binary
run: |
make build-prod
env:
APP_ENV: ${{ secrets.APP_ENV }}
APP_SECRET: ${{ secrets.APP_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
copy:
name: Copy binary to server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: copy file via ssh password
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.KEY }}
source: "/tmp/app"
target: /root/download
deploy:
name: Deploy on production
needs: copy
runs-on: ubuntu-latest
steps:
- name: Deploy commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
port: ${{ secrets.PORT }}
script: |
/root/scripts/deploy.sh