perf(admin): fix perf issue for card adding #60
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| - name: Contrôles qualité (lint, typecheck, audit) | |
| run: npm run ci:full | |
| docker: | |
| runs-on: ubuntu-latest | |
| needs: quality | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| - uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd | |
| - uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf | |
| id: meta | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=ref,event=pr | |
| type=sha,prefix=sha- | |
| - uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f | |
| with: | |
| context: . | |
| # Sur main : build de validation uniquement. Les tags semver + latest sont poussés par release-docker.yml. | |
| push: ${{ github.event_name == 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| release: | |
| name: semantic-release | |
| runs-on: ubuntu-latest | |
| needs: docker | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: write | |
| issues: write | |
| packages: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| - name: semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npm run release | |
| - name: Détecter la release publiée | |
| id: release | |
| run: | | |
| tag="$(git tag --points-at HEAD | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$' | sort -V | tail -n 1 || true)" | |
| if [[ -z "$tag" ]]; then | |
| echo "published=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "published=true" >> "$GITHUB_OUTPUT" | |
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
| if [[ "$tag" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "latest=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "latest=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd | |
| if: steps.release.outputs.published == 'true' | |
| - uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 | |
| if: steps.release.outputs.published == 'true' | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf | |
| if: steps.release.outputs.published == 'true' | |
| id: release-meta | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value=${{ steps.release.outputs.tag }} | |
| type=semver,pattern={{version}},value=${{ steps.release.outputs.tag }} | |
| type=semver,pattern={{major}}.{{minor}},value=${{ steps.release.outputs.tag }} | |
| type=raw,value=latest,enable=${{ steps.release.outputs.latest == 'true' }} | |
| - uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f | |
| if: steps.release.outputs.published == 'true' | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.release-meta.outputs.tags }} | |
| labels: ${{ steps.release-meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |