summaryrefslogtreecommitdiff
path: root/lib/bt/controller/lib_esp32/.gitlab-ci.yml
blob: d3b58bac0563ffd16f6397450a5f2d3107a0d3e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
stages:
  - deploy

push_master_to_github:
  stage: deploy
  tags:
    - internet
  only:
    - master
    - /^release\/v/
    - /^v\d+\.\d+/
#  when: on_success
  image: $CI_DOCKER_REGISTRY/esp32-ci-env
  variables:
    GIT_DEPTH: 0
  script:
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
    - base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
    - chmod 600 ~/.ssh/id_rsa
    - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
    - git remote add github git@github.com:espressif/esp32-bt-lib.git
    # Ref: esp-idf tools/ci/push_to_github.sh
    - |
      if [ -n "${CI_COMMIT_TAG}" ]; then
        git push github "${CI_COMMIT_TAG}"
      else
        git push github "${CI_COMMIT_SHA}:refs/heads/${CI_COMMIT_REF_NAME}"
      fi