-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
DotCipher
committed
Apr 3, 2024
1 parent
96bc34a
commit edd87ef
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
|
||
|