diff --git a/.github/workflows/build_docker_astro.yml b/.github/workflows/build_docker_astro.yml index 1aea57a..e1a31b7 100644 --- a/.github/workflows/build_docker_astro.yml +++ b/.github/workflows/build_docker_astro.yml @@ -32,8 +32,6 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=semver,pattern=latest - labels: | - org.opencontainers.image.title=AstroFront - name: Login to Gitea uses: docker/login-action@v3 diff --git a/.github/workflows/build_docker_express.yml b/.github/workflows/build_docker_express.yml index 001ff44..4cdd4d1 100644 --- a/.github/workflows/build_docker_express.yml +++ b/.github/workflows/build_docker_express.yml @@ -32,8 +32,6 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=semver,pattern=latest - labels: | - org.opencontainers.image.title=AstroFront - name: Login to Gitea uses: docker/login-action@v3 diff --git a/.github/workflows/build_jsdoc_drink.yml b/.github/workflows/build_jsdoc_drink.yml new file mode 100644 index 0000000..2c2641a --- /dev/null +++ b/.github/workflows/build_jsdoc_drink.yml @@ -0,0 +1,46 @@ +name: JsDocs +on: + pull_request: + branches: + - '*' +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout # rapatrie le depot + uses: actions/checkout@v3 + + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + git.lab-ouest.org/Epitech/ratrapage_T-WEB_drink_jsdocs + tags: | + type=edge + type=ref,event=pr + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=semver,pattern=latest + + - name: Login to Gitea + uses: docker/login-action@v3 + with: + registry: git.lab-ouest.org + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + - name: Build and push back + uses: docker/build-push-action@v5 + with: + context: ./Express/barAndCafe + push: true + file: ./Express/barAndCafe/Dockerfile_docs + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Express/barAndCafe/Dockerfile b/Express/barAndCafe/Dockerfile index 44cc089..09ee8fd 100644 --- a/Express/barAndCafe/Dockerfile +++ b/Express/barAndCafe/Dockerfile @@ -1,5 +1,3 @@ -# This Dockerfile allows you to run AstroJS in server mode - ######### # Build # ######### diff --git a/Express/barAndCafe/Dockerfile_docs b/Express/barAndCafe/Dockerfile_docs new file mode 100644 index 0000000..dab2b5c --- /dev/null +++ b/Express/barAndCafe/Dockerfile_docs @@ -0,0 +1,35 @@ +######### +# Build # +######### +FROM docker.io/node:20-alpine as BUILD_IMAGE + +# External deps (for node-gyp add: "python3 make g++") +RUN apk add --no-cache git + +# run as non root user +USER node + +# go to user repository +WORKDIR /home/node + +# Add package json +ADD --chown=node:node package.json package-lock.json ./ + +# install dependencies from package lock +RUN npm ci + +# Add project files +ADD --chown=node:node . . + +# build +RUN npm run docs + +# remove dev deps +RUN npm prune --omit=dev + +############## +# Production # +############## +FROM httpd:alpine + +COPY --from=BUILD_IMAGE /home/node/out/ /usr/local/apache2/htdocs/ \ No newline at end of file