From dfda847b7ebf9197873cf19cdbf4e898cb6200ac Mon Sep 17 00:00:00 2001 From: Fifo F Date: Fri, 25 Oct 2024 19:08:14 +0200 Subject: [PATCH 1/2] Delete Gitea CI file - handling CI actions by both GitLab and Gitea at the same time is a waste of system resources Signed-off-by: Fifo F --- .gitea/workflows/ci.yml | 52 ----------------------------------------- 1 file changed, 52 deletions(-) delete mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml deleted file mode 100644 index 5ebe22f..0000000 --- a/.gitea/workflows/ci.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Create complete Overleaf Docker image with all TeX Live packages -on: [push] - -jobs: - build: - runs-on: - labels: ubuntu-latest-privileged - services: - docker: - image: docker:24.0.5-dind - options: >- - --privileged - steps: - - name: Remove existing container to avoid conflicts, if present - run: | - if [ "$(docker ps -aq -f name=temp)" ]; then - docker rm -f temp - fi - - name: Log in to Gitea Docker registry - run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ vars.REGISTRY_HOST }} -u ${{ vars.REGISTRY_USER }} --password-stdin - - name: Get Overleaf version number - run: | - curl -sSfL https://raw.githubusercontent.com/overleaf/toolkit/master/lib/config-seed/version -o version.txt - echo "Image version: $(cat version.txt)" - - name: Pull Overleaf Docker image - run: docker pull sharelatex/sharelatex:latest - - name: Expand and save Docker image - run: | - OVERLEAF_VERSION=$(cat version.txt) - docker run --name temp --entrypoint /bin/bash sharelatex/sharelatex:latest -c " - tlmgr option repository https://ftp.tu-chemnitz.de/pub/tex/systems/texlive/tlnet/ && \ - tlmgr update --self --all && \ - tlmgr install scheme-full && \ - tlmgr path add && \ - apt update && apt install -y inkscape lilypond python3-pygments" - docker commit --change "ENTRYPOINT /sbin/my_init" temp sharelatex-with-texlive-full:${OVERLEAF_VERSION} - docker tag sharelatex-with-texlive-full:${OVERLEAF_VERSION} sharelatex-with-texlive-full:latest - - name: Push customized Docker image to registry - run: | - OVERLEAF_VERSION=$(cat version.txt) - docker tag sharelatex-with-texlive-full:${OVERLEAF_VERSION} ${{ vars.REGISTRY_HOST }}/tex-projects/sharelatex-with-texlive-full:${OVERLEAF_VERSION} - docker tag sharelatex-with-texlive-full:latest ${{ vars.REGISTRY_HOST }}/tex-projects/sharelatex-with-texlive-full:latest - docker push ${{ vars.REGISTRY_HOST }}/tex-projects/sharelatex-with-texlive-full:${OVERLEAF_VERSION} - docker push ${{ vars.REGISTRY_HOST }}/tex-projects/sharelatex-with-texlive-full:latest - - name: Clean up - run: | - OVERLEAF_VERSION=$(cat version.txt) - echo "Cleaning up" - docker rm -f temp - docker rmi sharelatex/sharelatex:latest - docker rmi ${{ vars.REGISTRY_HOST }}/tex-projects/sharelatex-with-texlive-full:${OVERLEAF_VERSION} - docker rmi ${{ vars.REGISTRY_HOST }}/tex-projects/sharelatex-with-texlive-full:latest \ No newline at end of file From effaaf803e6fdc3537fb7cf028574625e4f01501 Mon Sep 17 00:00:00 2001 From: "Fifo F." Date: Fri, 25 Oct 2024 21:16:37 +0000 Subject: [PATCH 2/2] Update .gitlab-ci.yml - only run the CI/CD pipeline on the main branch [skip ci] --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 271b73d..60dffec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,10 @@ variables: GITEA_IMAGE_NAME: ${GITEA_REGISTRY}/tex-projects/${IMAGE_NAME} DOCKER_HUB_IMAGE_NAME: ${DOCKER_HUB_USER}/${IMAGE_NAME} +workflow: + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + build: stage: build tags: