-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
38 lines (29 loc) · 1.09 KB
/
.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
33
34
35
36
37
38
image: alpine:latest
stages:
- sync
github_sync:
stage: sync
only:
- main
tags:
- k8s-runner
script:
- |
sed -i 's/https:\/\/dl-cdn.alpinelinux.org/http:\/\/mirrors.homelab.mathcrowd.cn/' /etc/apk/repositories
apk add --no-cache -f openssh git
- echo "Setting up SSH directory and permissions..."
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "Adding GitHub and CI server SSH hosts to known_hosts..."
- ssh-keyscan github.com > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo "Adding private keys to SSH..."
- echo "$GITHUB_KEY" > ~/.ssh/github.key
- chmod 400 ~/.ssh/github.key
- echo "Setting HTTP and HTTPS proxy..."
- git config --global http.proxy http://192.168.10.100:88
- git config --global https.proxy http://192.168.10.100:88
- echo "Adding GitHub remote repository..."
- git remote add github [email protected]:mathedu4all/mmarked-vscode-extension.git
- echo "Pushing to GitHub..."
- GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_SSH_COMMAND='ssh -i ~/.ssh/github.key' git push -f github HEAD:main --tags