diff --git a/.github/workflows/pr-playground-preview-publish.yml b/.github/workflows/pr-playground-preview-publish.yml new file mode 100644 index 00000000..4376e464 --- /dev/null +++ b/.github/workflows/pr-playground-preview-publish.yml @@ -0,0 +1,42 @@ +name: PR Playground Preview Publish + +on: + workflow_run: + workflows: + - PR Playground Preview Build + types: + - completed + +permissions: + actions: read + contents: write + pull-requests: write + +jobs: + publish: + permissions: + actions: read + contents: write + pull-requests: write + uses: WordPress/action-wp-playground-pr-preview/.github/workflows/preview-publish.yml@v3 + with: + blueprint: | + { + "$schema": "https://playground.wordpress.net/blueprint-schema.json", + "landingPage": "/wp-admin/options-general.php?page=two-factor-settings", + "steps": [ + { + "step": "login", + "username": "admin", + "password": "password" + }, + { + "step": "installPlugin", + "pluginZipFile": { + "resource": "url", + "url": "{{ARTIFACT_URL:two-factor}}" + }, + "options": { "activate": true } + } + ] + } diff --git a/.github/workflows/pr-playground-preview.yml b/.github/workflows/pr-playground-preview.yml new file mode 100644 index 00000000..f20ce989 --- /dev/null +++ b/.github/workflows/pr-playground-preview.yml @@ -0,0 +1,26 @@ +name: PR Playground Preview Build + +on: + pull_request: + types: [opened, synchronize, reopened, edited] + +permissions: + contents: read + +jobs: + build: + permissions: + contents: read + uses: WordPress/action-wp-playground-pr-preview/.github/workflows/preview-build.yml@v3 + with: + artifacts: two-factor=build/two-factor.zip + node-version: '20' + php-version: '8.3' + build-command: | + set -euo pipefail + npm ci + rm -rf build + npm run build + mkdir -p build/two-factor + rsync -a --delete dist/ build/two-factor/ + ( cd build && zip -qr two-factor.zip two-factor )