-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
32 lines (30 loc) · 867 Bytes
/
.gitlab-ci.yml
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
31
32
default:
tags:
- k8s-aws-tools
interruptible: true
stages:
- github-sync
sync_to_github:
image: python:3.11
stage: github-sync
variables:
KXSYSTEMS_GITHUB_REPO_NAME: "databricks-samples"
KXSYSTEMS_GITHUB_REPO: "https://${GITHUB_PAT}@github.com/KxSystems/${KXSYSTEMS_GITHUB_REPO_NAME}.git"
before_script:
- git config --global user.email "${GITHUB_USER_EMAIL}"
- git config --global user.name "${GITHUB_USERNAME}"
- git config --global url.https://${GITHUB_PAT}@github.com/.insteadOf https://github.com/
script:
- git remote add github "${KXSYSTEMS_GITHUB_REPO}"
- |
git fetch
git fetch github
- |
# useful for debugging
git remote -v
git status
git reflog
- git push github HEAD:$CI_COMMIT_BRANCH --force
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: manual