Skip to content

Commit

Permalink
Target staging site and make temporary changes for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpayton committed May 15, 2024
1 parent e128c95 commit 27ac275
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: Deploy to playground.wordpress.net
on:
workflow_dispatch:
# Deploy the website every day at 9am and 6pm UTC
schedule:
- cron: '0 9,18 * * *'
# TODO: Re-enable this before merge
#schedule:
# - cron: '0 9,18 * * *'

# TODO: Remove this before merging
pull_request:

concurrency:
group: website-deployment
Expand All @@ -14,15 +18,16 @@ concurrency:
jobs:
build_and_deploy:
# Only run this workflow from the trunk branch and when it's triggered by another workflow OR dmsnell OR adamziel
if: >
github.ref == 'refs/heads/trunk' && (
github.event_name == 'workflow_run' ||
github.event_name == 'workflow_dispatch' ||
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
github.actor == 'bgrgicak' ||
github.actor == 'brandonpayton'
)
#TODO: Re-enable this check before merging
#if: >
#github.ref == 'refs/heads/trunk' && (
# github.event_name == 'workflow_run' ||
# github.event_name == 'workflow_dispatch' ||
# github.actor == 'adamziel' ||
# github.actor == 'dmsnell' ||
# github.actor == 'bgrgicak' ||
# github.actor == 'brandonpayton'
#)

# Specify runner + deployment step
runs-on: ubuntu-latest
Expand All @@ -33,6 +38,7 @@ jobs:
- uses: ./.github/actions/prepare-playground
- run: npm run build

# TODO: Target production site before merging
- name: Deploy to playground.wordpress.net
shell: bash
run: |
Expand All @@ -44,19 +50,19 @@ jobs:
# Website files
rsync -avz -e "ssh -i ~/.ssh/id_ed25519" --delete \
dist/packages/artifacts/wasm-wordpress-net/ \
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }}:'~/updated-playground-files'
${{ secrets.STAGING_WEBSITE_TARGET_USER }}@${{ secrets.STAGING_WEBSITE_TARGET_HOST }}:'~/updated-playground-files'
# Host-specific deployment scripts and server config
rsync -avz -e "ssh -i ~/.ssh/id_ed25519" --delete \
packages/playground/website-deployment/ \
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }}:'~/website-deployment'
${{ secrets.STAGING_WEBSITE_TARGET_USER }}@${{ secrets.STAGING_WEBSITE_TARGET_HOST }}:'~/website-deployment'
# Copy MIME types for use with PHP-served files
scp -i ~/.ssh/id_ed25519 \
packages/php-wasm/universal/src/lib/mime-types.json \
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }}:'~/website-deployment/'
${{ secrets.STAGING_WEBSITE_TARGET_USER }}@${{ secrets.STAGING_WEBSITE_TARGET_HOST }}:'~/website-deployment/'
# Apply update
ssh -i ~/.ssh/id_ed25519 \
${{ secrets.DEPLOY_WEBSITE_TARGET_USER }}@${{ secrets.DEPLOY_WEBSITE_TARGET_HOST }} \
${{ secrets.STAGING_WEBSITE_TARGET_USER }}@${{ secrets.STAGING_WEBSITE_TARGET_HOST }} \
-tt -C '~/website-deployment/apply-update.sh'

0 comments on commit 27ac275

Please sign in to comment.