Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ name: Timeless CI - Build & Publish
on:
push:
branches: [ "main" ]
paths-ignore:
paths:
- 'timeless-api/**'
- 'whatsapp/**'
- 'infrastructure/**'
pull_request:
branches: [ "main" ]
paths-ignore:
paths:
- 'timeless-api/**'
- 'whatsapp/**'
- 'infrastructure/**'

permissions:
Expand All @@ -21,8 +25,13 @@ env:
PUBLISH: ${{ github.repository == 'mcruzdev/timeless' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}

jobs:
detect-changes:
uses: ./.github/workflows/detect_changes.yml

timeless-api:
name: Build & Publish - Timeless API (Java)
needs: detect-changes
if: needs.detect-changes.outputs.api == 'true'
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -84,6 +93,8 @@ jobs:

whatsapp:
name: Build & Publish - WhatsApp Bot (Node.js)
needs: detect-changes
if: needs.detect-changes.outputs.whatsapp == 'true'
runs-on: ubuntu-latest
defaults:
run:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/detect_changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Detect Changed Paths

on:
workflow_call:
outputs:
api:
description: Whether API paths changed
value: ${{ jobs.changes.outputs.api }}
whatsapp:
description: Whether WhatsApp paths changed
value: ${{ jobs.changes.outputs.whatsapp }}

jobs:
changes:
name: Detect changed paths
runs-on: ubuntu-latest
outputs:
api: ${{ steps.filter.outputs.api }}
whatsapp: ${{ steps.filter.outputs.whatsapp }}
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Filter paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
api:
- 'timeless-api/**'
whatsapp:
- 'whatsapp/**'
11 changes: 10 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: Timeless CI - Pull Request Build
on:
pull_request:
branches: [ "main" ]
paths-ignore:
paths:
- 'timeless-api/**'
- 'whatsapp/**'
- 'infrastructure/**'

permissions:
Expand All @@ -14,8 +16,13 @@ concurrency:
cancel-in-progress: true

jobs:
detect-changes:
uses: ./.github/workflows/detect_changes.yml

timeless-api:
name: Build Timeless API (Backend)
needs: detect-changes
if: needs.detect-changes.outputs.api == 'true'
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -56,6 +63,8 @@ jobs:

whatsapp:
name: Build WhatsApp Bot (Node.js)
needs: detect-changes
if: needs.detect-changes.outputs.whatsapp == 'true'
runs-on: ubuntu-latest
defaults:
run:
Expand Down