Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Test #29

Closed
wants to merge 25 commits into from
Closed

Test #29

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
03c4155
add comment et modif import dotenv
Khagou Apr 1, 2024
5dd78e2
first try deploiement raspberry pi
Khagou Apr 13, 2024
ad3410c
remove arm
Khagou Apr 13, 2024
4bf6d9b
replace scp by cat | ssh
Khagou Apr 13, 2024
10e6073
ajout step pour scp docker-compose.yml et modif de la step de deploie…
Khagou Apr 13, 2024
67a2c59
/Documents/docker-compose.yml -> ./Documents...
Khagou Apr 13, 2024
9837872
connexion ssh mano pour deploiement
Khagou Apr 13, 2024
c8000a0
specification de la cle dans la connexion
Khagou Apr 13, 2024
94f859d
creation de la cle ssh avec le secret et specification de la cle
Khagou Apr 13, 2024
95cbb66
..
Khagou Apr 13, 2024
d018942
ajout << EOF
Khagou Apr 13, 2024
4389507
ajout platform arm64 et amd64 au build des images et modif cd pour ut…
Khagou Apr 13, 2024
fb833c0
modif chemin scp
Khagou Apr 13, 2024
f4773a6
docker-compose up > docker compose up
Khagou Apr 13, 2024
da6b240
docker compose up > sudo docker compose up
Khagou Apr 13, 2024
c37f584
remove version dans docker-compose.yml
Khagou Apr 13, 2024
cb1c62a
change API url
Khagou Apr 13, 2024
3a8658f
change pipeline name
Khagou Apr 13, 2024
8981712
utilisation ip pour api
Khagou Apr 13, 2024
49857b5
essais certbot dans conteneur pour ssl
Khagou Apr 13, 2024
04c3c47
modif pyhton-certbot... to python3-certbo...
Khagou Apr 13, 2024
265f86a
1.6
Khagou Apr 13, 2024
937f860
daw
Khagou Apr 13, 2024
4ba06b2
remove certbot du script de deploiement
Khagou Apr 13, 2024
ccfc612
modif dockerfile front
Khagou Apr 13, 2024
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
83 changes: 8 additions & 75 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env: # Variables d'environnement declarées dans la vm de l'action
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
DB_USER_PASS: ${{ secrets.DB_USER_PASS }}
REACT_APP_URL_API: ${{ vars.REACT_APP_LOCAL_URL_API }} # les vars sont des variables d'environnement stockées dans le répertoire vars du repo sur github
TARGET_PLATFORM: linux/amd64, linux/arm64

jobs: # Jobs de l'action
Jest-tests: # Job de l'action pour les tests Jest
Expand Down Expand Up @@ -47,12 +48,7 @@ jobs: # Jobs de l'action
npm test
mv ./test-report.html ./back-jest-report.html

# - name: run back server # execution du serveur backend afin de pouvoir executer l'ensemble des tests du front
# run: |
# cd server
# npm run watch &

- name: Run front Jest tests # execution des tests Jest du frontend
- name: Run front Jest tests # execution des tests Jest du frontendD
run: |
cd client
npm test
Expand All @@ -66,73 +62,8 @@ jobs: # Jobs de l'action
./client/front-jest-report.html
./server/back-jest-report.html

Eslint-test:
runs-on: ubuntu-latest

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

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 20

- name: Install front dependencies
run: |
npm ci
working-directory: client

- name: Install back dependencies
run: |
npm ci
working-directory: server

- name: Where am i
run: |
pwd
ls

- name: Where am i server
run: |
pwd
ls -la
working-directory: server

- name: Where am i client
run: |
pwd
ls -la
working-directory: client

- name: Create eslint directory if not exists
run: mkdir -p eslint
working-directory: server

- name: Create eslint directory if not exists
run: mkdir -p eslint
working-directory: client

- name: Run front Eslint test
run: |
npm run lint || true
working-directory: client

- name: Run back Eslint test
run: |
npm run lint || true
working-directory: server

- name: Eslint reports
uses: actions/upload-artifact@v3
with:
name: eslint reports
path: |
client/eslint-report.html
server/eslint-report.html

build-and-push:
needs: [Jest-tests, Eslint-test]
needs: [Jest-tests]
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -165,24 +96,25 @@ jobs: # Jobs de l'action
run: |
echo "DB_USER_PASS=${{ secrets.DB_USER_PASS }}" > ./server/config/.env
cat ./server/config/.env
echo "REACT_APP_URL_API=${{ secrets.REACT_APP_URL_API }}" > ./client/.env
echo "REACT_APP_URL_API=${{ secrets.REACT_APP_URL_API_RASPBERRY }}" > ./client/.env
cat ./client/.env

- name: Build front
if: ${{ success() }}
env:
REACT_APP_URL_API: ${{ secrets.REACT_APP_URL_API }}
REACT_APP_URL_API: ${{ secrets.REACT_APP_URL_API_RASPBERRY }}
run: |
cd client
npm run build

- name: Build and push front
uses: docker/build-push-action@v2
env:
REACT_APP_URL_API: ${{ secrets.REACT_APP_URL_API }}
REACT_APP_URL_API: ${{ secrets.REACT_APP_URL_API_RASPBERRY }}
with:
context: ./client/
file: ./client/Dockerfile
platforms: ${{ env.TARGET_PLATFORM }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ vars.DOCKER_FRONT }}:${{ vars.DOCKER_FRONT_VERSION }}

Expand All @@ -193,5 +125,6 @@ jobs: # Jobs de l'action
with:
context: ./server/
file: ./server/Dockerfile
platforms: ${{ env.TARGET_PLATFORM }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ vars.DOCKER_BACK }}:${{ vars.DOCKER_BACK_VERSION }}
59 changes: 0 additions & 59 deletions .github/workflows/logging.yml

This file was deleted.

Loading
Loading