Studio Frontend Build #25
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: "Studio Frontend Build" | |
| on: | |
| push: | |
| branches: | |
| - "[0-9]+.[0-9]+" | |
| - "[0-9]+.x" | |
| - "feature-*" | |
| - "main" | |
| paths: | |
| - "assets/**" | |
| pull_request_target: | |
| branches: | |
| - "[0-9]+.[0-9]+" | |
| - "[0-9]+.x" | |
| - "*_actions" | |
| - "feature-*" | |
| - "main" | |
| paths: | |
| - "assets/**" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| install: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Cache npm dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./assets/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Fetch pimcore studio npm package archive | |
| working-directory: ./assets | |
| run: curl -o pimcore-studio-ui-bundle-0.0.1.tgz https://raw.githubusercontent.com/pimcore/studio-ui-bundle/1.x/public/build/studio-npm-package.tgz | |
| - name: Install dependencies | |
| working-directory: ./assets | |
| run: npm ci | |
| - name: Install studio npm package | |
| working-directory: ./assets | |
| run: npm install pimcore-studio-ui-bundle-0.0.1.tgz | |
| lint: | |
| needs: install | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Cache npm dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./assets/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Run code linting | |
| working-directory: ./assets | |
| run: npm run lint-fix | |
| - uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: Apply eslint-fixer changes | |
| build: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| repository: ${{ github.event.pull_request.head.repo.full_name }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Cache npm dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ./assets/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Fetch pimcore studio npm package archive | |
| working-directory: ./assets | |
| run: curl -o pimcore-studio-ui-bundle-0.0.1.tgz https://raw.githubusercontent.com/pimcore/studio-ui-bundle/1.x/public/build/studio-npm-package.tgz | |
| - name: Install studio npm package | |
| working-directory: ./assets | |
| run: npm install pimcore-studio-ui-bundle-0.0.1.tgz | |
| - name: Run production build | |
| working-directory: ./assets | |
| run: npm run build | |
| - uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| file_pattern: './public/' | |
| commit_message: Automatic frontend build |