Search blocks CI #78
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: Search blocks CI | |
| on: | |
| push: | |
| paths: | |
| - 'backend/**' | |
| - 'frontend/**' | |
| - '.github/workflows/backend.yml' | |
| - 'docs/**' | |
| - '.github/workflows/docs.yml' | |
| - .readthedocs.yaml | |
| - '.github/workflows/frontend.yml' | |
| - '.github/workflows/main.yml' | |
| - 'devops/**' | |
| workflow_dispatch: | |
| env: | |
| IMAGE_NAME_PREFIX: ghcr.io/collective/collective-searchblocks | |
| NODE_VERSION: '22.x' | |
| PYTHON_VERSION: '3.12' | |
| jobs: | |
| config: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| backend: ${{ steps.filter.outputs.backend }} | |
| docs: ${{ steps.filter.outputs.docs }} | |
| frontend: ${{ steps.filter.outputs.frontend }} | |
| BASE_TAG: ${{ steps.vars.outputs.BASE_TAG }} | |
| IMAGE_NAME_PREFIX: ${{ env.IMAGE_NAME_PREFIX }} | |
| NODE_VERSION: ${{ env.NODE_VERSION }} | |
| PYTHON_VERSION: ${{ env.PYTHON_VERSION }} | |
| PLONE_VERSION: ${{ steps.vars.outputs.PLONE_VERSION }} | |
| VOLTO_VERSION: ${{ steps.vars.outputs.VOLTO_VERSION }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Compute several vars needed for the CI | |
| id: vars | |
| run: | | |
| echo "BASE_TAG=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "PLONE_VERSION=$(cat backend/version.txt)" >> $GITHUB_OUTPUT | |
| python3 -c 'import json; data = json.load(open("./frontend/mrs.developer.json")); print("VOLTO_VERSION=" + (data["core"].get("tag") or "latest"))' >> $GITHUB_OUTPUT | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| backend: | |
| - 'backend/**' | |
| - '.github/workflows/backend.yml' | |
| docs: | |
| - 'docs/**' | |
| - .readthedocs.yaml | |
| - '.github/workflows/docs.yml' | |
| frontend: | |
| - 'frontend/**' | |
| - '.github/workflows/frontend.yml' | |
| - name: Test vars | |
| run: | | |
| echo 'BASE_TAG=${{ steps.vars.outputs.BASE_TAG }}' | |
| echo 'PLONE_VERSION=${{ steps.vars.outputs.PLONE_VERSION }}' | |
| echo 'VOLTO_VERSION=${{ steps.vars.outputs.VOLTO_VERSION }}' | |
| echo 'backend: ${{ steps.filter.outputs.backend }}' | |
| echo 'docs: ${{ steps.filter.outputs.docs }}' | |
| echo 'frontend: ${{ steps.filter.outputs.frontend }}' | |
| backend: | |
| uses: ./.github/workflows/backend.yml | |
| needs: | |
| - config | |
| with: | |
| base-tag: ${{ needs.config.outputs.BASE_TAG }} | |
| image-name-prefix: ${{ needs.config.outputs.IMAGE_NAME_PREFIX }} | |
| image-name-suffix: backend | |
| python-version: ${{ needs.config.outputs.PYTHON_VERSION }} | |
| plone-version: ${{ needs.config.outputs.PLONE_VERSION }} | |
| if: ${{ needs.config.outputs.backend == 'true' }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| docs: | |
| uses: ./.github/workflows/docs.yml | |
| needs: | |
| - config | |
| with: | |
| python-version: ${{ needs.config.outputs.PYTHON_VERSION }} | |
| if: ${{ needs.config.outputs.docs == 'true' }} | |
| frontend: | |
| uses: ./.github/workflows/frontend.yml | |
| needs: | |
| - config | |
| with: | |
| base-tag: ${{ needs.config.outputs.BASE_TAG }} | |
| image-name-prefix: ${{ needs.config.outputs.IMAGE_NAME_PREFIX }} | |
| image-name-suffix: frontend | |
| node-version: ${{ needs.config.outputs.NODE_VERSION }} | |
| volto-version: ${{ needs.config.outputs.VOLTO_VERSION }} | |
| if: ${{ needs.config.outputs.frontend == 'true' }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| report: | |
| name: 'Final report' | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - config | |
| - backend | |
| - frontend | |
| - docs | |
| steps: | |
| - name: Write report | |
| run: | | |
| echo '# Workflow Report' >> $GITHUB_STEP_SUMMARY | |
| echo '| Job ID | Conclusion |' >> $GITHUB_STEP_SUMMARY | |
| echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY | |
| echo '| config | ${{ needs.config.result }} |' >> $GITHUB_STEP_SUMMARY | |
| echo '| backend | ${{ needs.backend.result }} |' >> $GITHUB_STEP_SUMMARY | |
| echo '| docs | ${{ needs.docs.result }} |' >> $GITHUB_STEP_SUMMARY | |
| echo '| frontend | ${{ needs.frontend.result }} |' >> $GITHUB_STEP_SUMMARY |