docs turbo, exec turbo build from workflows

This commit is contained in:
Max Peintner
2025-07-11 13:50:59 +02:00
parent 4d0ecf915b
commit d9b0a1287b
5 changed files with 134 additions and 5 deletions

View File

@@ -34,6 +34,12 @@ jobs:
node_version: "20" node_version: "20"
buf_version: "latest" buf_version: "latest"
docs:
uses: ./.github/workflows/docs.yml
with:
node_version: "20"
buf_version: "latest"
version: version:
uses: ./.github/workflows/version.yml uses: ./.github/workflows/version.yml
with: with:
@@ -86,7 +92,7 @@ jobs:
actions: write actions: write
id-token: write id-token: write
with: with:
ignore-run-cache: ${{ github.event_name == 'workflow_dispatch' || fromJSON(github.run_attempt) > 1 }} ignore-run-cache: ${{ github.event_name == 'workflow_dispatch' || fromJSON(github.run_attempt) > 1 }}
node_version: "20" node_version: "20"
container: container:
@@ -121,7 +127,16 @@ jobs:
issues: write issues: write
pull-requests: write pull-requests: write
needs: needs:
[version, core-unit-test, core-integration-test, lint, container, login-container, login-quality, e2e] [
version,
core-unit-test,
core-integration-test,
lint,
container,
login-container,
login-quality,
e2e,
]
if: ${{ github.event_name == 'workflow_dispatch' }} if: ${{ github.event_name == 'workflow_dispatch' }}
secrets: secrets:
GCR_JSON_KEY_BASE64: ${{ secrets.GCR_JSON_KEY_BASE64 }} GCR_JSON_KEY_BASE64: ${{ secrets.GCR_JSON_KEY_BASE64 }}

View File

@@ -49,7 +49,11 @@ jobs:
cache: "pnpm" cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml cache-dependency-path: pnpm-lock.yaml
- if: ${{ steps.cache.outputs.cache-hit != 'true' }} - if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: make console_build name: Install dependencies
run: pnpm install
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Build console with Turbo
run: pnpm turbo build --filter=./console
- if: ${{ steps.cache.outputs.cache-hit != 'true' }} - if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4 uses: actions/cache/save@v4
with: with:

61
.github/workflows/docs.yml vendored Normal file
View File

@@ -0,0 +1,61 @@
name: Build docs
on:
workflow_call:
inputs:
node_version:
required: true
type: string
buf_version:
required: true
type: string
outputs:
cache_key:
value: ${{ jobs.build.outputs.cache_key }}
cache_path:
value: ${{ jobs.build.outputs.cache_path }}
env:
cache_path: docs/build
jobs:
build:
outputs:
cache_key: ${{ steps.cache.outputs.cache-primary-key }}
cache_path: ${{ env.cache_path }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
timeout-minutes: 1
continue-on-error: true
id: cache
with:
key: docs-${{ hashFiles('docs', 'proto', '!docs/build', '!docs/node_modules') }}
restore-keys: |
docs-
path: ${{ env.cache_path }}
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
version: ${{ inputs.buf_version }}
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: pnpm/action-setup@v4
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Install dependencies
run: pnpm install
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Build docs with Turbo
run: pnpm turbo build --filter=./docs
- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: ${{ env.cache_path }}
key: ${{ steps.cache.outputs.cache-primary-key }}

View File

@@ -4,7 +4,7 @@ on:
workflow_call: workflow_call:
inputs: inputs:
ignore-run-cache: ignore-run-cache:
description: 'Ignore run caches' description: "Ignore run caches"
type: boolean type: boolean
required: true required: true
node_version: node_version:
@@ -43,7 +43,16 @@ jobs:
run: | run: |
tar -xvf .artifacts/zitadel-linux-amd64.tar.gz tar -xvf .artifacts/zitadel-linux-amd64.tar.gz
mv zitadel-linux-amd64/zitadel ./zitadel mv zitadel-linux-amd64/zitadel ./zitadel
- run: make login_quality - uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- name: Run login quality checks with Turbo
run: pnpm turbo lint test:unit --filter=./login
env: env:
# latest if branch is main, otherwise image version which is the pull request number # latest if branch is main, otherwise image version which is the pull request number
LOGIN_BAKE_CLI: depot bake LOGIN_BAKE_CLI: depot bake

40
docs/turbo.json Normal file
View File

@@ -0,0 +1,40 @@
{
"$schema": "https://turbo.build/schema.json",
"extends": ["//"],
"tasks": {
"generate": {
"dependsOn": ["^generate"],
"outputs": ["docs/api/**", "docs/self-hosting/manage/configure/*.yaml"],
"cache": true
},
"generate:grpc": {
"dependsOn": ["^generate"],
"outputs": ["docs/api/**"],
"cache": true
},
"generate:apidocs": {
"dependsOn": ["generate:grpc"],
"outputs": ["docs/api/**"],
"cache": true
},
"generate:configdocs": {
"outputs": ["docs/self-hosting/manage/configure/*.yaml"],
"cache": true
},
"build": {
"dependsOn": ["generate"],
"outputs": ["build/**"],
"cache": true
},
"start": {
"dependsOn": ["generate"],
"cache": false,
"persistent": true
},
"start:api": {
"dependsOn": ["generate"],
"cache": false,
"persistent": true
}
}
}