diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..e28b0e4 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,64 @@ +name: CI TP Noté + +on: + push: + branches: [develop] + +jobs: + test-memory-2026: + runs-on: self-hosted + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Test JPEG + run: | + for file in $(find . -type f \( -name "*.jpg" -o -name "*.jpeg" \)); do + file "$file" + done + + build-memory-2026: + needs: test-memory-2026 + runs-on: self-hosted + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Build Docker image + run: | + docker build -t docker.io/${{ secrets.DOCKER_USERNAME }}/memory-2026:latest . + + + puush-memory-2026: + needs: build-memory-2026 + runs-on: self-hosted + steps: + - name: Login Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Push the image + uses: docker/build-push-action@v6 + with: + push: true + tags: docker.io/${{ secrets.DOCKER_USERNAME }}/memory-2026:latest + + deploy-memory-2026: + needs: puush-memory-2026 + runs-on: self-hosted + steps: + - name: Pull docker image + run: docker pull iwtpl/memory-2026:latest + + - name: Build the container + run: docker run -d \ + --name memory \ + -p 8080:80 \ + iwtpl/memory-2026:latest + + diff --git a/.gitignore b/.gitignore index 496ee2c..5824317 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -.DS_Store \ No newline at end of file +.DS_Store +Dockerfiile +test 2 + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..da7c419 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM debian:bullseye + +RUN apt-get update && apt-get install -y \ + nginx \ + php-fpm \ + php-mysql \ + curl \ + file \ + && rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /run/php + +RUN rm -rf /var/www/html/* + +COPY ./html /var/www/html +COPY ./html /var/concentration/html + +COPY ./conf/nginx.conf /etc/nginx/nginx.conf + +EXPOSE 80 + +CMD php-fpm7.4 -F & nginx -g "daemon off;" + + diff --git a/html/data/0.jpg b/html/data/0.jpg old mode 100755 new mode 100644 index 0e259d4..65f28a4 Binary files a/html/data/0.jpg and b/html/data/0.jpg differ diff --git a/html/data/11.jpg b/html/data/11.jpg old mode 100755 new mode 100644 index 0e259d4..65f28a4 Binary files a/html/data/11.jpg and b/html/data/11.jpg differ diff --git a/html/data/15.jpg b/html/data/15.jpg old mode 100755 new mode 100644 index 0e259d4..65f28a4 Binary files a/html/data/15.jpg and b/html/data/15.jpg differ diff --git a/html/data/28.jpg b/html/data/28.jpg old mode 100755 new mode 100644 index 545b203..65f28a4 Binary files a/html/data/28.jpg and b/html/data/28.jpg differ