Skip to content

Commit

Permalink
merge ci/ci into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
julesartd authored Mar 7, 2024
2 parents 96b7f30 + 2986387 commit a9fb42a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: SSH Upload and Composer Install

on:
push:
branches:
- dev
- ci/ci-cd-for-api

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 * ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:/home/julesartd/www/api-dev-edt-3il

- name: SSH into server and run composer install
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/julesartd/www/api-dev-edt-3il/backend
composer2 install
4 changes: 0 additions & 4 deletions backend/src/Controller/Api/TimetableController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ public function index(Request $request): JsonResponse
$parsedJson = $this->timetableService->fetchAndParseData($xmlUrl);
return $this->json($parsedJson);
} else {
<<<<<<< HEAD
return $this->json(['error' => 'Invalid XML url'], JsonResponse::HTTP_BAD_REQUEST);
=======
return $this->json(['error' => 'Invalid xml url'], JsonResponse::HTTP_BAD_REQUEST);
>>>>>>> dev
}
}
}

0 comments on commit a9fb42a

Please sign in to comment.