Chore: combine bugfixes #625
Workflow file for this run
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: "CI/CD" | |
on: | |
push: | |
branches: | |
- main | |
- 1.0-branch | |
- 2.0-branch | |
- 'release/**' | |
pull_request: | |
types: [opened, synchronize] | |
env: | |
E2E_ARTIFACT: e2e-run-${{ github.run_id }}-${{ github.run_number }} | |
# Cancels all previous workflow runs for pull requests that have not completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name for pull requests | |
# or the commit hash for any other events. | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build and Install Dependencies | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
outputs: | |
composer-files-dir: ${{ steps.composer-cache.outputs.composer-files-dir }} | |
steps: | |
- name: Check Out Code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js Environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Set up pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Prepare Node Modules Cache | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
**/node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-node-modules- | |
- name: Set up PHP, with Composer and Extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
tools: composer:v2 | |
php-version: '8.0' | |
- name: Set up Problem Matchers for PHP | |
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
- name: Get Composer Cache Files Directory | |
id: composer-cache | |
working-directory: plugins/wme-sitebuilder | |
run: | | |
echo "composer-files-dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Prepare Composer Dependencies Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.composer-cache.outputs.composer-files-dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install Dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
lint: | |
name: Lint JS and PHP | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Check Out Code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js Environment | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Set up pnpm | |
uses: pnpm/[email protected] | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Prepare Node Modules Cache | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
**/node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-node-modules- | |
- name: Set up PHP, with Composer and Extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
tools: composer:v2 | |
php-version: '8.0' | |
- name: Set up Problem Matchers for PHP | |
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
- name: Prepare Composer Dependencies Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{needs.build.outputs.composer-files-dir}} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install Dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Lint | |
run: pnpm lint | |
deploy: | |
if: ${{ github.ref_name == 'main' || github.ref_name == '1.0-branch' || github.ref_name == '2.0-branch' }} | |
name: Deploy to Test Sites | |
needs: [build, lint] | |
uses: ./.github/workflows/deploy.yml | |
secrets: | |
ssh-key: ${{ secrets.SITEBUILDER_SSH_PRIVATE_KEY }} | |