Skip to content

Commit

Permalink
Enhance build workflow and add sync on delete functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
pfhuillet committed Dec 17, 2024
1 parent 5305877 commit c1f35d4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ name: Build
on:
push:
pull_request:
delete:
workflow_dispatch:

jobs:
build:
name: "Build on ${{ matrix.os }}"
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:
Expand All @@ -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 }}

20 changes: 20 additions & 0 deletions .github/workflows/sync_on_deleted.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit c1f35d4

Please sign in to comment.