chore: github actions
This commit is contained in:
75
.github/workflows/docker-build.yml
vendored
75
.github/workflows/docker-build.yml
vendored
@@ -3,55 +3,37 @@ name: Docker Build and Push
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
# branches: [ "main" ]
|
paths-ignore:
|
||||||
paths:
|
# README and docs
|
||||||
- "apps/api/**"
|
- "**/README*"
|
||||||
- "apps/worker/**"
|
- "**/readme*"
|
||||||
|
- "**/*.md"
|
||||||
|
- "**/docs/**"
|
||||||
|
- "**/CHANGELOG*"
|
||||||
|
- "**/LICENSE*"
|
||||||
|
# Test files
|
||||||
|
- "**/*.test.*"
|
||||||
|
- "**/*.spec.*"
|
||||||
|
- "**/__tests__/**"
|
||||||
|
- "**/tests/**"
|
||||||
|
# SDKs (published separately)
|
||||||
|
- "packages/sdks/**"
|
||||||
|
# Public app (docs/marketing, not part of Docker deploy)
|
||||||
- "apps/public/**"
|
- "apps/public/**"
|
||||||
- "apps/start/**"
|
# Dev / tooling
|
||||||
- "packages/**"
|
- "**/.vscode/**"
|
||||||
- "!packages/sdks/**"
|
- "**/.cursor/**"
|
||||||
- "**Dockerfile"
|
- "**/.env.example"
|
||||||
- ".github/workflows/**"
|
- "**/.env.*.example"
|
||||||
|
- "**/.gitignore"
|
||||||
|
- "**/.eslintignore"
|
||||||
|
- "**/.prettierignore"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
repo_owner: "openpanel-dev"
|
repo_owner: "openpanel-dev"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
changes:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
api: ${{ steps.filter.outputs.api }}
|
|
||||||
worker: ${{ steps.filter.outputs.worker }}
|
|
||||||
public: ${{ steps.filter.outputs.public }}
|
|
||||||
dashboard: ${{ steps.filter.outputs.dashboard }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: dorny/paths-filter@v2
|
|
||||||
id: filter
|
|
||||||
with:
|
|
||||||
base: "main"
|
|
||||||
filters: |
|
|
||||||
api:
|
|
||||||
- 'apps/api/**'
|
|
||||||
- 'packages/**'
|
|
||||||
- '.github/workflows/**'
|
|
||||||
worker:
|
|
||||||
- 'apps/worker/**'
|
|
||||||
- 'packages/**'
|
|
||||||
- '.github/workflows/**'
|
|
||||||
public:
|
|
||||||
- 'apps/public/**'
|
|
||||||
- 'packages/**'
|
|
||||||
- '.github/workflows/**'
|
|
||||||
dashboard:
|
|
||||||
- 'apps/start/**'
|
|
||||||
- 'packages/**'
|
|
||||||
- '.github/workflows/**'
|
|
||||||
|
|
||||||
lint-and-test:
|
lint-and-test:
|
||||||
needs: changes
|
|
||||||
if: ${{ needs.changes.outputs.api == 'true' || needs.changes.outputs.worker == 'true' || needs.changes.outputs.public == 'true' || needs.changes.outputs.dashboard == 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
redis:
|
redis:
|
||||||
@@ -106,8 +88,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: write
|
contents: write
|
||||||
needs: [changes, lint-and-test]
|
needs: lint-and-test
|
||||||
if: ${{ needs.changes.outputs.api == 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -167,8 +148,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: write
|
contents: write
|
||||||
needs: [changes, lint-and-test]
|
needs: lint-and-test
|
||||||
if: ${{ needs.changes.outputs.worker == 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -228,8 +208,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
packages: write
|
packages: write
|
||||||
contents: write
|
contents: write
|
||||||
needs: [changes, lint-and-test]
|
needs: lint-and-test
|
||||||
if: ${{ needs.changes.outputs.dashboard == 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|||||||
Reference in New Issue
Block a user