include: - project: o/infra/templates file: /gitlab-ci/includes/StrapiBuildDeploy.yaml Push to Docker Hub: stage: deploy retry: 2 image: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] rules: - if: "$CI_COMMIT_TAG =~ /v.*$/" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: manual variables: CI_REGISTRY_IMAGE: octree/caroster script: - echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"$DOCKER_HUB_AUTH\"}}}" > /kaniko/.docker/config.json - "[[ -f VERSION.txt ]] && VERSION=$(cat VERSION.txt) || VERSION=${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA}" - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$VERSION --build-arg VERSION=$VERSION - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:latest --build-arg VERSION=$VERSION