|
1 | 1 | name: "Studio Frontend Build" |
2 | | - |
| 2 | + |
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: |
6 | | - - "[0-9]+.[0-9]+" |
7 | | - - "[0-9]+.x" |
8 | | - - "feature-*" |
9 | | - - "nightly" |
10 | | - - "studio" |
11 | 5 | paths: |
12 | 6 | - "assets/studio/**" |
13 | | - pull_request_target: |
14 | | - branches: |
15 | | - - "[0-9]+.[0-9]+" |
16 | | - - "[0-9]+.x" |
17 | | - - "*_actions" |
18 | | - - "feature-*" |
19 | | - - "nightly" |
| 7 | + pull_request: |
20 | 8 | paths: |
21 | 9 | - "assets/studio/**" |
22 | 10 | workflow_dispatch: |
23 | | - |
24 | | -env: |
25 | | - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} |
26 | | - |
| 11 | + |
27 | 12 | permissions: |
28 | | - contents: read |
29 | | - |
| 13 | + contents: write |
| 14 | + |
30 | 15 | jobs: |
31 | | - install: |
32 | | - runs-on: ubuntu-latest |
33 | | - |
34 | | - steps: |
35 | | - - name: Checkout code |
36 | | - uses: actions/checkout@v4 |
37 | | - with: |
38 | | - ref: ${{ env.BRANCH_NAME }} |
39 | | - repository: ${{ github.event.pull_request.head.repo.full_name }} |
40 | | - |
41 | | - - name: Set up Node.js |
42 | | - uses: actions/setup-node@v4 |
43 | | - with: |
44 | | - node-version: 22 |
45 | | - |
46 | | - - name: Cache npm dependencies |
47 | | - uses: actions/cache@v4 |
48 | | - with: |
49 | | - path: ./assets/studio/node_modules |
50 | | - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
51 | | - restore-keys: | |
52 | | - ${{ runner.os }}-node- |
53 | | - - name: Install dependencies |
54 | | - working-directory: ./assets/studio |
55 | | - run: npm ci |
56 | | - |
57 | | - lint: |
58 | | - needs: install |
59 | | - runs-on: ubuntu-latest |
60 | | - |
61 | | - permissions: |
62 | | - contents: write |
63 | | - |
64 | | - steps: |
65 | | - - name: Checkout code |
66 | | - uses: actions/checkout@v4 |
67 | | - with: |
68 | | - ref: ${{ env.BRANCH_NAME }} |
69 | | - repository: ${{ github.event.pull_request.head.repo.full_name }} |
70 | | - |
71 | | - - name: Set up Node.js |
72 | | - uses: actions/setup-node@v4 |
73 | | - with: |
74 | | - node-version: 22 |
75 | | - |
76 | | - - name: Cache npm dependencies |
77 | | - uses: actions/cache@v4 |
78 | | - with: |
79 | | - path: ./assets/studio/node_modules |
80 | | - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
81 | | - restore-keys: | |
82 | | - ${{ runner.os }}-node- |
83 | | - - name: Run code linting |
84 | | - working-directory: ./assets/studio |
85 | | - run: npm run lint-fix |
86 | | - |
87 | | - - uses: stefanzweifel/git-auto-commit-action@v5 |
88 | | - with: |
89 | | - commit_message: Apply eslint-fixer changes |
90 | | - |
91 | | - check-types: |
92 | | - needs: install |
93 | | - runs-on: ubuntu-latest |
94 | | - |
95 | | - permissions: |
96 | | - contents: write |
97 | | - |
98 | | - steps: |
99 | | - - name: Checkout code |
100 | | - uses: actions/checkout@v4 |
101 | | - with: |
102 | | - ref: ${{ env.BRANCH_NAME }} |
103 | | - repository: ${{ github.event.pull_request.head.repo.full_name }} |
104 | | - |
105 | | - - name: Set up Node.js |
106 | | - uses: actions/setup-node@v4 |
107 | | - with: |
108 | | - node-version: 22 |
109 | | - |
110 | | - - name: Cache npm dependencies |
111 | | - uses: actions/cache@v4 |
112 | | - with: |
113 | | - path: ./assets/studio/node_modules |
114 | | - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
115 | | - restore-keys: | |
116 | | - ${{ runner.os }}-node- |
117 | | - - name: Run code linting |
118 | | - working-directory: ./assets/studio |
119 | | - run: npm run check-types |
120 | | - |
121 | | - build: |
122 | | - needs: |
123 | | - - lint |
124 | | - - check-types |
125 | | - runs-on: ubuntu-latest |
126 | | - |
127 | | - permissions: |
128 | | - contents: write |
129 | | - |
130 | | - steps: |
131 | | - - name: Checkout code |
132 | | - uses: actions/checkout@v4 |
133 | | - with: |
134 | | - ref: ${{ env.BRANCH_NAME }} |
135 | | - repository: ${{ github.event.pull_request.head.repo.full_name }} |
136 | | - |
137 | | - - name: Set up Node.js |
138 | | - uses: actions/setup-node@v4 |
139 | | - with: |
140 | | - node-version: 22 |
141 | | - |
142 | | - - name: Cache npm dependencies |
143 | | - uses: actions/cache@v4 |
144 | | - with: |
145 | | - path: ./assets/studio/node_modules |
146 | | - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
147 | | - restore-keys: | |
148 | | - ${{ runner.os }}-node- |
149 | | - - name: Run production build |
150 | | - working-directory: ./assets/studio |
151 | | - run: npm run build |
152 | | - |
153 | | - - uses: stefanzweifel/git-auto-commit-action@v5 |
154 | | - with: |
155 | | - file_pattern: './src/Resources/public/studio/' |
156 | | - commit_message: Automatic frontend build |
| 16 | + studio-frontend-build: |
| 17 | + uses: pimcore/workflows-collection-public/.github/workflows/reusable-studio-frontend-build.yaml@main |
0 commit comments