Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 3 additions & 59 deletions .github/workflows/frontcicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test CI trigger

on: [push]

permissions:
contents: write

jobs:
frontend-build-and-test:
runs-on: ubuntu-latest
Expand All @@ -26,62 +29,3 @@ jobs:
- name: Build Angular app
run: npm run build
working-directory: ./
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: sanalyz
POSTGRES_PASSWORD: sanalyz
POSTGRES_DB: sanalyz
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

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

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Run tests
run: mvn test
working-directory: ./API


gh-pages-deploy:
runs-on: ubuntu-latest
needs: frontend-build-and-test
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '21'

- name: Build Angular app
run: |
npm install
npm run build
working-directory: ./

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./

deploy:
runs-on: ubuntu-latest
needs: [frontend-build-and-test, gh-pages-deploy]
steps:
- name: Final deployment
run: echo "Deployment done"