Skip to content

Commit 75cb426

Browse files
committed
set up gitlab sync
1 parent 315ee92 commit 75cb426

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/sync.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Sync to GitLab
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0 # Important for mirroring history
15+
- name: Mirror to GitLab
16+
run: |
17+
git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@${{ secrets.GITLAB_REPO_URL | replace('https://', '') }}
18+
git push --force --prune gitlab +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*

.gitlab-ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This tells the runner which Docker image to start
2+
image: openjdk:latest
3+
4+
# The 'stages' block defines the order of work
5+
stages:
6+
- test
7+
8+
# This is our first job
9+
verify-java-job:
10+
stage: test
11+
script:
12+
- java -version
13+
- echo "Hello from gitlab-runner-one! The 'Kitchen' is open."

0 commit comments

Comments
 (0)