From c1f35d412b8f298e851ce0c8e3dad6eb3d32c2b1 Mon Sep 17 00:00:00 2001 From: Pierre-Francois Huillet <120171685+pfhuillet@users.noreply.github.com> Date: Tue, 17 Dec 2024 11:52:39 +0100 Subject: [PATCH] Enhance build workflow and add sync on delete functionality --- .github/workflows/build.yml | 21 +++++++++++++++++---- .github/workflows/sync_on_deleted.yml | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/sync_on_deleted.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc9b79a..6f196a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,6 @@ name: Build on: push: pull_request: - delete: - workflow_dispatch: jobs: build: @@ -11,11 +9,15 @@ jobs: strategy: fail-fast: false matrix: - os: [ macos-latest, windows-latest, ubuntu-24.04 ] + os: [ macOS,Windows,ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + - name: Build uses: 4d/build4d-action@main with: @@ -32,8 +34,19 @@ jobs: with: fetch-depth: 0 lfs: true - - uses: wangchucheng/git-repo-sync@v0.1.0 + + - name: Get Internal Sync action + uses: actions/checkout@v4 + with: + repository: 4d/gitlabsync-action + ref: main + path: .github/workflows/external/sync + token: ${{ secrets.CI_GIT_SYNC }} + + - id: Sync + uses: ./.github/workflows/external/sync/ with: target-url: ${{ secrets.TARGET_URL }} target-username: ${{ secrets.TARGET_USERNAME }} target-token: ${{ secrets.TARGET_TOKEN }} + diff --git a/.github/workflows/sync_on_deleted.yml b/.github/workflows/sync_on_deleted.yml new file mode 100644 index 0000000..11f5344 --- /dev/null +++ b/.github/workflows/sync_on_deleted.yml @@ -0,0 +1,20 @@ +name: Delete + +on: + delete + +jobs: + sync: + runs-on: [self-hosted, macOS, ARM64] + name: Git Repo Sync + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + - uses: 4d/gitlabsync-action@main + with: + target-url: ${{ secrets.TARGET_URL }} + target-username: ${{ secrets.TARGET_USERNAME }} + target-token: ${{ secrets.TARGET_TOKEN }} +