Add live playground links using woocommerce as inspiration #2
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: Build Live Branch | ||
Check failure on line 1 in .github/workflows/build-live-branch.yml
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'examples/**' | ||
- 'bin/**' | ||
- '**/tests/**' | ||
- '**/*.md' | ||
- '.github/**' | ||
- '!.github/workflows/pr-build-live-branch.yml' | ||
concurrency: | ||
# Cancel concurrent jobs on pull_request but not push, by including the run_id in the concurrency group for the latter. | ||
group: build-${{ github.event_name == 'push' && github.run_id || 'pr' }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
env: | ||
FORCE_COLOR: 1 | ||
permissions: {} | ||
jobs: | ||
build: | ||
if: github.repository_owner == 'Automattic' && github.event.pull_request.draft == false && github.event.pull_request.user.login != 'github-actions[bot]' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
repository-projects: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Prepare plugin zips | ||
id: prepare | ||
env: | ||
ZIP_NAME: remote-data-blocks-${{ github.event.pull_request.number }}.zip | ||
run: | | ||
echo "Generating zip file..." | ||
cd "$GITHUB_WORKSPACE" || exit | ||
cd ../ | ||
zip -q -r -9 "$ZIP_NAME" "remote-data-blocks/" | ||
mkdir "$GITHUB_WORKSPACE/zips" | ||
mv "$ZIP_NAME" "$GITHUB_WORKSPACE/zips/" | ||
mkdir -p "$GITHUB_WORKSPACE/unzips/remote-data-blocks" | ||
cd "$GITHUB_WORKSPACE/zips" | ||
unzip -qq "$ZIP_NAME" | ||
mv "$GITHUB_WORKSPACE/zips/remote-data-blocks" "$GITHUB_WORKSPACE/unzips/remote-data-blocks/remote-data-blocks" | ||
- name: Create plugins artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: remote-data-blocks-${{ github.event.pull_request.number }} | ||
path: zips | ||
# Only need to retain for a day since the beta builder slurps it up to distribute. | ||
retention-days: 1 | ||
- name: Create playground artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: remote-data-blocks-${{ github.event.pull_request.number }} | ||
path: unzips/remote-data-blocks | ||
retention-days: 30 | ||
- name: Comment on PR with WordPress Playground details | ||
uses: actions/github-script@v7 | ||
if: ! github.event.pull_request.head.repo.fork | ||
with: | ||
script: | | ||
const { run } = require('./.github/workflows/scripts/generate-playground-blueprint'); | ||
run({ github, context, core }); |