diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6d1f7a8c7..e0aa863b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -190,30 +190,6 @@ pages: services: - docker:stable-dind cache: {} - tags: - - "privileged" - -build-docker-main: - <<: *docker - rules: - - if: '$CI_PROJECT_NAMESPACE != "framasoft"' - when: never - - if: '$CI_PIPELINE_SOURCE == "schedule"' - before_script: - # Login to DockerHub - - mkdir -p ~/.docker - - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$CI_REGISTRY_AUTH\",\"email\":\"$CI_REGISTRY_EMAIL\"}}}" > ~/.docker/config.json - script: - - docker build -t framasoft/mobilizon:main -f docker/production/Dockerfile . - - docker push framasoft/mobilizon:main - -build-docker-tag: - <<: *docker - rules: &tag-rules - - if: '$CI_PROJECT_NAMESPACE != "framasoft"' - when: never - - if: $CI_COMMIT_TAG - timeout: 3 hours before_script: # Install buildx - wget https://github.com/docker/buildx/releases/download/v0.6.3/buildx-v0.6.3.linux-amd64 @@ -229,6 +205,25 @@ build-docker-tag: # Login to DockerHub - mkdir -p ~/.docker - echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$CI_REGISTRY_AUTH\",\"email\":\"$CI_REGISTRY_EMAIL\"}}}" > ~/.docker/config.json + tags: + - "privileged" + +build-docker-main: + <<: *docker + rules: + - if: '$CI_PROJECT_NAMESPACE != "framasoft"' + when: never + - if: '$CI_PIPELINE_SOURCE == "schedule"' + script: + - docker buildx build --push --platform linux/amd64 -t framasoft/mobilizon:main -f docker/production/Dockerfile . + +build-docker-tag: + <<: *docker + rules: &tag-rules + - if: '$CI_PROJECT_NAMESPACE != "framasoft"' + when: never + - if: $CI_COMMIT_TAG + timeout: 3 hours script: - > docker buildx build