diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..138716d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,28 @@ +# Fichiers et dossiers de node +node_modules +npm-debug.log + +# Dossiers de build et de cache +dist +.tmp +.cache + +# Fichiers de configuration et d'environnement +.dockerignore +Dockerfile +.git +.gitignore +README.md +LICENSE +*.md + +# Fichiers spécifiques à l'éditeur +.vscode +.idea +*.sublime-project +*.sublime-workspace + +# Autres fichiers et dossiers inutiles pour la construction ou l'exécution de l'application +*.spec.ts +*.test.ts +*.sass-cache diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..05e2628 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,28 @@ +name: Odoo Middleware CI/CD + +on: + push: + branches: + - main + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: SSH into the deployment server + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_KEY }} + script: | + cd /opt/test/M1Front + sudo git pull + sudo docker build -t front . + sudo docker rm -f m1front + docker run -d -p 8010:80 --name m1front front:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..18faf51 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:14 as build-stage +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +FROM nginx:alpine as deploy-stage +COPY --from=build-stage /app/dist/fuse /usr/share/nginx/html +COPY default.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..7c38d71 --- /dev/null +++ b/default.conf @@ -0,0 +1,8 @@ +server { + listen 80; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } +} diff --git a/src/app/layout/common/search/search.component.html b/src/app/layout/common/search/search.component.html index 689f7b8..084b7bc 100644 --- a/src/app/layout/common/search/search.component.html +++ b/src/app/layout/common/search/search.component.html @@ -28,7 +28,7 @@ - No results found! + No result found!