fix(workflows): Prefix dependabot PR titles (#397) #19
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
| # This workflow creates a release based upon the information in our wp-boilerplate repositories. | |
| # It assumes that `npm install`, `composer install` and `npx grunt release` are valid commands. | |
| # The action expects a valid zip file in the `./update/` folder and the `slug` key in the | |
| # `package.json` to be set. | |
| name: 🚀 Release Please | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| release-please: | |
| name: Release Please | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: googleapis/release-please-action@v4 | |
| id: release | |
| with: | |
| token: ${{ secrets.GH_ADMIN_TOKEN }} | |
| - uses: actions/checkout@v3 | |
| if: ${{ steps.release.outputs.release_created }} | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GH_ADMIN_TOKEN }} | |
| - name: ⚙️ Configure git | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: | | |
| git config user.name $GITHUB_ACTOR | |
| git config user.email gh-actions-${GITHUB_ACTOR}@github.com | |
| - uses: actions/setup-node@v3 | |
| if: ${{ steps.release.outputs.release_created }} | |
| with: | |
| node-version: 20 | |
| - name: ⚙️ Setup PHP with tools | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.3' | |
| tools: composer:v2 | |
| - name: 💾 Get node.js cache directory | |
| if: ${{ steps.release.outputs.release_created }} | |
| id: node-cache-dir | |
| run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT # Use $(yarn cache dir) for yarn | |
| - name: 💾 Cache dependencies | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ steps.node-cache-dir.outputs.dir }} | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} # Use '**/yarn.lock' for yarn | |
| restore-keys: ${{ runner.os }}-node- | |
| - name: 💾 Get composer cache directory | |
| if: ${{ steps.release.outputs.release_created }} | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: ⚙️ Cache dependencies | |
| if: ${{ steps.release.outputs.release_created }} | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: ⚙️ Install Composer Packages | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: composer install --prefer-dist | |
| - name: ⚙️ Install Node Packages | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: npm i | |
| - name: 🔎 Lint the code | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: npm run lint | |
| - name: 🏗 Build the code release | |
| if: ${{ steps.release.outputs.release_created }} | |
| run: npm run release | |
| - name: Upload Release Artifact | |
| if: ${{ steps.release.outputs.release_created }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release upload ${{ steps.release.outputs.tag_name }} ./archives/*.zip --clobber | |
| - name: 🚢 Deploy to Update Server | |
| if: ${{ success() && steps.release.outputs.release_created }} | |
| uses: easingthemes/ssh-deploy@main | |
| with: | |
| SSH_PRIVATE_KEY: ${{ secrets.UPDATE_SERVER_PRIVATE_KEY }} | |
| SOURCE: "./archives/" | |
| REMOTE_HOST: ${{ secrets.UPDATE_SERVER_HOST }} | |
| REMOTE_USER: ${{ secrets.UPDATE_SERVER_USER }} | |
| TARGET: ${{ secrets.UPDATE_SERVER_PATH }} |