Skip to content

Commit

Permalink
Adding CI Workflow config
Browse files Browse the repository at this point in the history
  • Loading branch information
DotCipher committed Apr 3, 2024
1 parent 96bc34a commit edd87ef
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Continuous Integration Suivie Physique

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-test-deploy:
name: Build & Test & Deploy Suivie Physique App
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 17
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: éé# ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Unit Test Backend
run: mvn -B test --file backend/pom.xml

- name: Build Backend App
run: |
mvn clean
mvn -B package --file backend/pom.xml
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '16'

- name: Cache Node Modules
uses: actions/cache@v2
env:
cache-name: cacheÃ-node-modules
with:
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ runner.os }}-build-${{ runner.os }}
- name: Install Dependencies
run: npm install

- name: Running Frontend Tests
run: npm test:ci

- name: Building Frontend App
run: npm build:ci

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and Push to Dockerhub
uses: docker/build-push-action@v5
with:
context: .
file: ./docker-compose.yml
push: true
tags: suivie-physique/app:latest




0 comments on commit edd87ef

Please sign in to comment.