This commit is contained in:
Elio Bischof
2025-06-23 13:38:36 +02:00
parent 4c701abe4b
commit b7f2f5ceff

View File

@@ -1,35 +1,30 @@
name: Quality name: Quality
on: on:
push:
pull_request: pull_request:
pull_request_target:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
ref-tag: force:
description: 'The tag to use for the build cache' description: 'Whether to ignore the run caches'
required: false required: false
default: 'latest' default: true
clean-run-caches:
description: 'Whether to clean the run caches'
required: false
default: 'true'
jobs: jobs:
quality: quality:
name: Ensure Quality name: Ensure Quality
runs-on: depot-ubuntu-22.04-8 if: github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.repository_owner != 'zitadel') ||
(github.event_name == 'pull_request' && github.repository_owner != 'zitadel') ||
(github.event_name == 'pull_request_target' && github.repository_owner != 'zitadel')
runs-on: ubuntu-22.04
timeout-minutes: 30 timeout-minutes: 30
permissions: permissions:
contents: read contents: read # We only need read access to the repository contents
id-token: write actions: write # We need write access to the actions cache
packages: write
actions: write
env: env:
CACHE_DIR: /tmp/login-run-caches CACHE_DIR: /tmp/login-run-caches
# Only run this job on workflow_dispatch or pushes to forks
steps: steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Docker meta - name: Docker meta
id: meta id: meta
@@ -44,9 +39,8 @@ jobs:
type=semver,pattern={{version}} type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}} type=semver,pattern={{major}}
- uses: depot/setup-action@v1 - name: Set up Buildx
with: uses: docker/setup-buildx-action@v3
oidc: true
- name: Restore Run Caches - name: Restore Run Caches
uses: actions/cache/restore@v4 uses: actions/cache/restore@v4
id: run-caches-restore id: run-caches-restore
@@ -59,10 +53,7 @@ jobs:
${{ runner.os }}-login-run-caches- ${{ runner.os }}-login-run-caches-
- run: make login-quality - run: make login-quality
env: env:
# latest if branch is main, otherwise image version which is the pull request number FORCE: ${{ github.event.inputs.force == 'true' }}
BAKE_CLI: depot bake
DEPOT_PROJECT_ID: jp837jn3fm
FORCE: ${{ github.event.inputs.clean-run-caches == 'true' }}
- name: Save Run Caches - name: Save Run Caches
uses: actions/cache/save@v4 uses: actions/cache/save@v4
with: with: