Skip to content

Commit

Permalink
add branch deploy github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Moggach committed Oct 31, 2024
1 parent 7017bad commit 52ac666
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/branch-deploys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: InstaWP WordPress Testing

on: push

jobs:
create-wp-for-testing:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Composer dependencies
uses: php-actions/composer@v6

- name: Zip up artefact
uses: vimtor/[email protected]
with:
files: web/app
dest: builds/wordpress-starter-template-${{ github.sha }}.zip

- name: Deploy artefact to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./builds
publish_branch: builds

- name: Wait for GitHub Pages to deploy
run: sleep 60

- name: Deploy to InstaWP
uses: instawp/wordpress-testing-automation@main
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
INSTAWP_TOKEN: ${{secrets.INSTAWP_TOKEN}}
INSTAWP_TEMPLATE_SLUG: wordpress-starter-template
EXPIRY_HOURS: 1
REPO_ID: 555
INSTAWP_ACTION: create-site-template
ARTIFACT_URL: https://commonknowledge.github.io/wordpress-starter-template/wordpress-starter-template-${{ github.sha }}.zip

0 comments on commit 52ac666

Please sign in to comment.