Update composer.json #21
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: Build and push to build branch. | |
on: | |
push: | |
branches: [trunk] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 | |
- name: Install NodeJS | |
uses: actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Setup PHP with PECL extension | |
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2.25.4 | |
with: | |
php-version: '7.4' | |
env: | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install all dependencies | |
run: | | |
composer install | |
npm ci | |
- name: Lint | |
run: | | |
npm run lint:php | |
npm run lint:js | |
npm run lint:css | |
- name: Build | |
run: npm run build | |
- name: Add build files, remove source files. | |
run: | | |
rm -rf node_modules vendor | |
git rm .editorconfig .eslintrc.js .gitignore .nvmrc .prettierrc.js .stylelintrc .wp-env.json composer.lock package-lock.json phpcs.xml.dist | |
git rm -r .github | |
git add build --force | |
- name: Commit and push | |
# Using a specific hash here instead of a tagged version, for risk mitigation, since this action modifies our repo. | |
uses: actions-js/push@156f2b10c3aa000c44dbe75ea7018f32ae999772 # 1.4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: build | |
force: true | |
message: 'Build: ${{ github.sha }}' |