-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (116 loc) · 4.09 KB
/
main.yml
File metadata and controls
126 lines (116 loc) · 4.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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