-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (44 loc) · 1.51 KB
/
build.yml
File metadata and controls
56 lines (44 loc) · 1.51 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Hyuil build
on: [push, pull_request]
jobs:
# 1. Build and Test Job - 모든 브랜치에서 수행
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
# 2. Push to Another Repository Job - 메인 브랜치에서만 수행
push-to-another-repo:
runs-on: ubuntu-latest
needs: build # 빌드가 완료된 후 실행
if: github.ref == 'refs/heads/main' # 메인 브랜치일 때만 실행
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create output
run: sh ./build.sh
- name: Pushes to another repository
id: push_directiry
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{secrets.AUTO_ACTIONS}}
with:
source-directory: 'output'
destination-github-username: seo0o519
destination-repository-name: HYUIL
user-email: ${{ secrets.EMAIL }}
commit-message: ${{ github.event.commits[0].message }}
target-branch: main
- name: Test get variable exported by push-to-another-repository
run: echo $DESTINATION_CLONED_DIRECTORY