Commit e8a67425 authored by Grant's avatar Grant
Browse files

Merge branch '151-doc-wiki' into 'main'

Documentation wiki

Closes #151

See merge request !54
parents 07e5f9a8 7e9b372c
Loading
Loading
Loading
Loading
+20 −41
Original line number Diff line number Diff line
stages:
  - publish
  - deploy

variables:
  REGISTRY: registry.sc07.dev
  IMAGE_NAME: sc07/canvas:edge

publish:
  stage: publish
  tags:
    - red
include:
  - local: ".gitlab/ci/wiki.yml"
    rules:
    - if: $CI_COMMIT_BRANCH == "main"
    - changes:
        - ".gitlab/*"
      when: never
      - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
      - changes:
        - "**/*.md"
      when: manual
  interruptible: true
  before_script:
    - echo $PAT | docker login $REGISTRY -u $GITLAB_USER_LOGIN --password-stdin
  script:
    - docker build . --tag $REGISTRY/$IMAGE_NAME
    - docker push $REGISTRY/$IMAGE_NAME

deploy:
  stage: deploy
  tags:
    - red
          - doc/**/*
  - local: ".gitlab/ci/deploy.yml"
    rules:
    - if: $CI_COMMIT_BRANCH == "main"
      - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
      - changes:
          # exclude documentation changes from deploy
          - "doc/**/*"
          - ".gitlab/*"
        when: never
    - changes:
        - "**/*.md"
      when: manual

# dummy job, gitlab gets mad when no jobs exist (when the above are never imported)
dummy:
  stage: build
  interruptible: true
  script:
    - cd $WORK_DIR
    - docker compose pull
    - docker compose up -d
    - echo "dummy"
  # rules:
  #   - when: never

.gitlab/ci/deploy.yml

0 → 100644
+32 −0
Original line number Diff line number Diff line
variables:
  REGISTRY: registry.sc07.dev
  IMAGE_NAME: sc07/canvas:edge

publish:
  stage: publish
  tags:
    - red
  rules:
    - changes:
        - "**/*.md"
      when: manual
  interruptible: true
  before_script:
    - echo $PAT | docker login $REGISTRY -u $GITLAB_USER_LOGIN --password-stdin
  script:
    - docker build . --tag $REGISTRY/$IMAGE_NAME
    - docker push $REGISTRY/$IMAGE_NAME

deploy:
  stage: deploy
  tags:
    - red
  rules:
    - changes:
        - "**/*.md"
      when: manual
  interruptible: true
  script:
    - cd $WORK_DIR
    - docker compose pull
    - docker compose up -d

.gitlab/ci/wiki.yml

0 → 100644
+16 −0
Original line number Diff line number Diff line
# sync /doc/ to internal wiki repo for UI access
# see #151
build-wiki:
  image: alpine
  stage: build
  before_script:
    - apk add --no-cache git git-subtree
  script:
    - git config user.email "ci@sc07.company"
    - git config user.name "ci"
    - git remote remove gitlab-wiki || true
    - git remote add gitlab-wiki "https://ci:$CI_TOKEN@sc07.dev/sc07/canvas.wiki.git"
    - git status
    - git checkout main
    - git pull
    - git push gitlab-wiki `git subtree split -P doc main`:main --force

doc/home.md

0 → 100644
+3 −0
Original line number Diff line number Diff line
# Canvas

Documentation example