Skip to content

Commit

Permalink
👷: Added CI for main
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPLukaas committed Mar 15, 2024
1 parent 47b93a0 commit ae1c754
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy-backend-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Upload backend to PROD server and lint

on:
push:
branches:
- prod

env:
FLUTTER_VERSION: 3.10.1

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Upload PHP code
run: scp -o StrictHostKeyChecking=no -r backend ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:/home/imjames/www/API-3IL/prod

install_dependencies:
needs: deploy
runs-on: ubuntu-latest

steps:
- name: SSH Into Server and Install Composer Dependencies
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/imjames/www/API-3IL/prod/backend
composer2 install
- name: SSH Into Server and execute Linter for PHP
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/imjames/www/API-3IL/prod/backend
vendor/bin/php-cs-fixer fix src


0 comments on commit ae1c754

Please sign in to comment.