Deploy to playground.wordpress.net #12
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: Deploy to playground.wordpress.net | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [Refresh WordPress assets] | |
types: | |
- completed | |
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.actor == 'adamziel' || | |
github.actor == 'dmsnell' | |
) | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
environment: | |
name: playground-wordpress-net | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/prepare-playground | |
- run: npm run build | |
- run: tar -czf wasm-wordpress-net.tar.gz dist/packages/playground/wasm-wordpress-net | |
# Store dist/packages/artifacts/wasm-wordpress-net as a build artifact | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: playground-website | |
path: wasm-wordpress-net.tar.gz | |
# The artifact only becomes available after this workflow wraps up, so let's wrap. | |
# The deploy-website.yml workflow will pick up the artifact and deploy it. |