Skip to content

Commit f818f7f

Browse files
committed
ci: Push branch and tags to GitHub
1 parent 71b91c3 commit f818f7f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.gitlab-ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ variables:
99
ARCHIVE_DIR: "dist"
1010
ORIGIN_NAME: "com.espressif.idf.update-1.0.0-SNAPSHOT.zip"
1111

12+
.add_gh_key_remote: &add_gh_key_remote |
13+
cit_add_ssh_key "${GH_PUSH_KEY}"
14+
git remote remove github || true
15+
git remote add github ${GH_PUSH_REPO}
16+
1217
before_script:
1318
# Use CI Tools
1419
- curl -sSL ${CIT_LOADER_URL} | sh
@@ -87,3 +92,26 @@ public_http:
8792
SRV_UPLOAD_PATH: ${DL_SERVER_SSH}:${SRV_DIR}
8893
SRV_LATEST_NAME: latest
8994
SRV_HTTP_URL: ${DL_SERVER_HTTP}/${SRV_DIR}
95+
96+
.git_sync_template: &git_sync_template
97+
stage: public_deploy
98+
when: manual
99+
tags:
100+
- deploy
101+
dependencies: []
102+
103+
push_master_to_github:
104+
<<: *git_sync_template
105+
only:
106+
- master
107+
script:
108+
- *add_gh_key_remote
109+
- git push github "${CI_COMMIT_SHA}:${CI_COMMIT_REF_NAME}"
110+
111+
push_tag_to_github:
112+
<<: *git_sync_template
113+
only:
114+
- /^v[0-9].*$/
115+
script:
116+
- *add_gh_key_remote
117+
- git push github "${CI_COMMIT_TAG}"

0 commit comments

Comments
 (0)