Commit 24f6f2f1 authored by Girija Saint-Ange's avatar Girija Saint-Ange
Browse files

Merge branch 'feat/parallel-deploy' into 'master'

feat: remove S3 and use parallel deployments for review

See merge request to-be-continuous/doc!125
parents 224e0868 30c3dc5d
Loading
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -4,10 +4,6 @@ include:
  - project: '$TBC_NAMESPACE/mkdocs'
    ref: '2'
    file: '/templates/gitlab-ci-mkdocs.yml'
  # S3 template
  - project: '$TBC_NAMESPACE/s3'
    ref: '7'
    file: '/templates/gitlab-ci-s3.yml'

variables:
  # Default value; can be globally overridden
@@ -17,14 +13,9 @@ variables:
  MKD_LYCHEE_ENABLED: "true"
  MKD_LYCHEE_ARGS: "*.md docs/ static/"

  # deploy: landing page (static/), mkdocs build (public/), Angular build (kicker/dist/) and aggregated kicker (kicker-aggregated/)
  S3_DEPLOY_FILES: "static/ public/ kicker-aggregated.json"
  S3_STAGING_DISABLED: "true"
  S3_PROD_DISABLED: "true"
  S3_STAGING_PREFIX: "doc"
  # segregate review envs with prefixes
  S3_REVIEW_PREFIX: ${CI_COMMIT_REF_SLUG}
  S3_REVIEW_AUTOSTOP_DURATION: one week
  PAGES_PREFIX: "" # No prefix for main or master
  EXPIRE_IN: "never" # No expiration for main or master
  ENVIRONMENT_NAME: "production"

stages:
  - codegen
@@ -101,10 +92,21 @@ pages:
    - find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\|json\)$' -exec gzip -f -k {} \;
    # not available in image
    # - find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\|json\)$' -exec brotli -f -k {} \;
  pages:
    path_prefix: '$PAGES_PREFIX'
    expire_in: $EXPIRE_IN
  artifacts:
    name: "complete site from $CI_COMMIT_REF_SLUG"
    paths:
      - public
    expire_in: 1 day
  only:
    - master
  environment:
    name: '$ENVIRONMENT_NAME'
    url: $CI_PAGES_URL
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run on main or master with default PAGES_PREFIX (empty)
    - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH # Run on other branches with prefix CI_COMMIT_REF_SLUG
      variables:
        PAGES_PREFIX: '$CI_COMMIT_REF_SLUG' # Prefix with CI_COMMIT_REF_SLUG for other branches
        EXPIRE_IN: 4 hrs # Pages expire in 4 hours for other branches
        ENVIRONMENT_NAME: 'review/$CI_COMMIT_REF_SLUG'
 No newline at end of file