fix: Fix prepare-plugin script #14
This file contains 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: Prepare Plugin for deployment | |
concurrency: prepare-plugin | |
on: | |
push: | |
branches: | |
- main | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: prepare-plugin | |
steps: | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
coverage: none | |
tools: composer, cs2pr | |
- name: Set up NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT_TOKEN }} | |
fetch-depth: 0 | |
- name: Composer cache | |
id: composer-cache | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: composer-prod-${{ hashFiles( 'composer.lock' ) }}-${{ hashFiles( '.github/workflows/main.yml' ) }} | |
- name: NodeJS cache | |
id: node-cache | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node-prod-${{ hashFiles( 'package-lock.json' ) }}-${{ hashFiles( '.github/workflows/main.yml' ) }} | |
- name: Install Composer dependencies | |
if: steps.composer-cache.outputs.cache-hit != 'true' | |
run: composer install --no-dev | |
- name: Install NodeJS dependencies | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: npm ci --omit=dev | |
- name: Push to built branch | |
env: | |
BUILT_BRANCH: ${{ env.BRANCH_NAME }}-built | |
run: bash .bin/prepare.sh |