From 52ac666f56ad402d3bc3534848f7111ecce1d0ec Mon Sep 17 00:00:00 2001 From: Moggach Date: Thu, 31 Oct 2024 12:00:13 +0000 Subject: [PATCH] add branch deploy github action --- .github/workflows/branch-deploys.yml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/branch-deploys.yml diff --git a/.github/workflows/branch-deploys.yml b/.github/workflows/branch-deploys.yml new file mode 100644 index 0000000..eaecbeb --- /dev/null +++ b/.github/workflows/branch-deploys.yml @@ -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/action-zip@v1.2 + 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 \ No newline at end of file