Skip to content

Commit da0e45e

Browse files
committed
Enhance GitHub Actions: streamline build workflow and add sync on delete functionality
1 parent 38f03f3 commit da0e45e

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

.github/workflows/build.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@ name: Build
22
on:
33
push:
44
pull_request:
5-
delete:
6-
workflow_dispatch:
75

86
jobs:
97
build:
108
name: "Build on ${{ matrix.os }}"
119
strategy:
1210
fail-fast: false
1311
matrix:
14-
os: [ macos-latest, windows-latest, ubuntu-24.04 ]
12+
os: [ macOS,Windows]
1513
runs-on: ${{ matrix.os }}
1614
steps:
1715
- name: Checkout
1816
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
lfs: true
20+
1921
- name: Build
2022
uses: 4d/build4d-action@main
2123
with:
@@ -32,8 +34,19 @@ jobs:
3234
with:
3335
fetch-depth: 0
3436
lfs: true
35-
- uses: wangchucheng/git-repo-sync@v0.1.0
37+
38+
- name: Get Internal Sync action
39+
uses: actions/checkout@v4
40+
with:
41+
repository: 4d/gitlabsync-action
42+
ref: main
43+
path: .github/workflows/external/sync
44+
token: ${{ secrets.CI_GIT_SYNC }}
45+
46+
- id: Sync
47+
uses: ./.github/workflows/external/sync/
3648
with:
3749
target-url: ${{ secrets.TARGET_URL }}
3850
target-username: ${{ secrets.TARGET_USERNAME }}
3951
target-token: ${{ secrets.TARGET_TOKEN }}
52+

.github/workflows/sync_on_deleted.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Delete
2+
3+
on:
4+
delete
5+
6+
jobs:
7+
sync:
8+
runs-on: [self-hosted, macOS, ARM64]
9+
name: Git Repo Sync
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
lfs: true
15+
- uses: 4d/gitlabsync-action@main
16+
with:
17+
target-url: ${{ secrets.TARGET_URL }}
18+
target-username: ${{ secrets.TARGET_USERNAME }}
19+
target-token: ${{ secrets.TARGET_TOKEN }}
20+

0 commit comments

Comments
 (0)