-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Run Playground Script and Deploy to gh-pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- trunk | ||
- main | ||
- develop | ||
- wp-now-support | ||
|
||
permissions: | ||
contents: write # Ensure the workflow has write permissions | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Playground Script | ||
run: ./scripts/playground.sh | ||
|
||
- name: Set up Git configuration | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Clone the gh-pages branch | ||
run: | | ||
git clone --single-branch --branch gh-pages https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} gh-pages | ||
cd gh-pages | ||
BRANCH_NAME=${GITHUB_REF_NAME} | ||
if [ -d "$BRANCH_NAME" ]; then | ||
rm -rf "$BRANCH_NAME" | ||
fi | ||
- name: Copy dist to branch directory | ||
run: | | ||
BRANCH_NAME=${GITHUB_REF_NAME} | ||
mv dist gh-pages/$BRANCH_NAME | ||
- name: Commit and push changes | ||
run: | | ||
cd gh-pages | ||
git add . | ||
git commit -m "Deploy to gh-pages branch from ${GITHUB_REF_NAME}" | ||
git push origin gh-pages --force | ||
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
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