Skip to content

Commit 1c166d9

Browse files
Fix up private website deployment workflow after initial commit (#29)
## Motivation for the change, related issues Some tweaks are needed to the private website deployment workflow, now that it exists on trunk and can be manually tested. ## Implementation details - Fix name to say it is for private site deployment - Fix other issues discovered in testing. ## Testing Instructions (or ideally a Blueprint) - Manually run the workflow and confirm that it succeeds. - Try to access the site while unproxied, and confirm you receive an "Unauthorized. Please proxy" message. - Try to access the site while proxied, and confirm that Playground loads successfully.
1 parent 9eba050 commit 1c166d9

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

.github/workflows/deploy-private-website.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy to playground.wordpress.net
1+
name: Deploy private Playground web app
22

33
on:
44
workflow_dispatch:
@@ -37,14 +37,6 @@ jobs:
3737
submodules: true
3838
- uses: ./.github/actions/prepare-playground
3939
- run: npm run build
40-
- run: tar -czf wasm-wordpress-net.tar.gz dist/packages/playground/wasm-wordpress-net
41-
# Store dist/packages/artifacts/wasm-wordpress-net as a build artifact
42-
- uses: actions/upload-artifact@v4
43-
with:
44-
name: playground-website
45-
path: wasm-wordpress-net.tar.gz
46-
# The artifact only becomes available after this workflow wraps up, so let's wrap.
47-
# This artifact enables the download of a pre-built package and hosting of one's own playground instance.
4840

4941
- name: Deploy to playground.wordpress.net
5042
shell: bash
@@ -69,12 +61,12 @@ jobs:
6961
packages/php-wasm/universal/src/lib/mime-types.json \
7062
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }}:'~/website-deployment/'
7163
72-
# Require A8C proxy for private web app
64+
# Apply update
7365
ssh -i ~/.ssh/id_ed25519 \
7466
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }} \
75-
-tt -C 'echo "if ( \"cli\" !== php_sapi_name() && empty( \$_SERVER[\"A8C_PROXIED_REQUEST\"] ) ) { http_response_code( 401 ); echo \"Unauthorized. Please proxy.\"; die(); }" >> ~/website-deployment/custom-redirects.php'
67+
-tt '~/website-deployment/apply-update.sh'
7668
77-
# Apply update
69+
# Require A8C proxy for private web app
7870
ssh -i ~/.ssh/id_ed25519 \
7971
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }} \
80-
-tt -C '~/website-deployment/apply-update.sh'
72+
-tt 'sed -i "2i if ( \"cli\" !== php_sapi_name() && empty( \$_SERVER[\"A8C_PROXIED_REQUEST\"] ) ) { http_response_code( 401 ); echo \"Unauthorized. Please proxy.\"; die(); }" ~/htdocs/custom-redirects.php'

0 commit comments

Comments
 (0)