Skip to content

Commit d00a440

Browse files
authored
Merge pull request #15 from SWM-FIRE/FIRE-248-ops-git-lab-activity에-하령님-안-나오는-것-해결하기
FIRE-248 Fix CD GitHub Actions
2 parents a0058f8 + ba971b7 commit d00a440

File tree

2 files changed

+58
-35
lines changed

2 files changed

+58
-35
lines changed

.github/workflows/gitlab-cd.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# This is a workflow that syncs everthing on this repository to another repository
2+
# using GitLab Token
3+
4+
name: Sync GitHub to GitLab
5+
6+
on:
7+
push:
8+
pull_request:
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
push-to-gitlab:
15+
runs-on: ubuntu-latest
16+
17+
# Steps represent a sequence of tasks that will be executed as part of the job
18+
steps:
19+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0 # Fetch all history for all tags and branches
23+
24+
- name: Print commit author
25+
run: |
26+
echo ${{ github.actor }}
27+
28+
- name: Set remote repository (071yoon)
29+
if: ${{ github.actor == '071yoon' }}
30+
env:
31+
gitlab_url: ${{ secrets.TARGET_URL }}
32+
gitlab_username: ${{ secrets.TARGET_USERNAME }}
33+
gitlab_token: ${{ secrets.TARGET_TOKEN }}
34+
run: |
35+
git remote add gitlab https://${gitlab_username}:${gitlab_token}@${gitlab_url#https://};
36+
37+
- name: Set remote repository (haryung-lee)
38+
if: ${{ github.actor == 'haryung-lee' }}
39+
env:
40+
gitlab_url: ${{ secrets.TARGET_URL }}
41+
gitlab_username: ${{ secrets.TARGET_USERNAME_HALANG }}
42+
gitlab_token: ${{ secrets.TARGET_TOKEN_HALANG }}
43+
run: |
44+
git remote add gitlab https://${gitlab_username}:${gitlab_token}@${gitlab_url#https://};
45+
46+
- name: Set remote repository (IamGroooooot)
47+
if: ${{ github.actor == 'IamGroooooot' }}
48+
env:
49+
gitlab_url: ${{ secrets.TARGET_URL }}
50+
gitlab_username: ${{ secrets.TARGET_USERNAME_JUHYEONG }}
51+
gitlab_token: ${{ secrets.TARGET_TOKEN_JUHYEONG }}
52+
run: |
53+
git remote add gitlab https://${gitlab_username}:${gitlab_token}@${gitlab_url#https://};
54+
55+
- name: Force push everthing
56+
run: |
57+
git push -f --all gitlab;
58+
git push -f --tags gitlab;

.github/workflows/gitlab-ci.yml

-35
This file was deleted.

0 commit comments

Comments
 (0)