refactor structure & design #1
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: Build plugin | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [16.x] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Cache NPM dependencies | |
| uses: actions/[email protected] | |
| id: node_modules-cache | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| - name: Install NPM dependencies | |
| if: steps.node_modules-cache.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Build assets | |
| run: npm run build | |
| - name: Cache Composer dependencies | |
| uses: actions/[email protected] | |
| id: vendor-cache | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
| - name: Install Composer dependencies | |
| uses: php-actions/composer@v6 | |
| with: | |
| php_version: "8.2" | |
| - name: Zip | |
| run: zip -r "${GITHUB_REPOSITORY#*/}.zip" . -x .git\* -x .github\* -x node_modules\* -x src\* -x .DS_Store | |
| shell: bash | |
| - name: Upload zip | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ github.event.repository.name }} | |
| path: ${{ github.event.repository.name }}.zip |