Skip to content

Commit

Permalink
feat: working with autobuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukerten committed Jun 9, 2024
1 parent 10f16db commit 82117d9
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/playground.yml
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Project page: https://hackathon.cloudfest.com/project/json-schema-field-form-ren

## Demo

check out the state of this project [here](aaaah)

This Monorepo contains example uses cases of [JSON Schema](https://json-schema.org/) in WordPress.

It demo's the use of [JSON Schema](https://json-schema.org/) as abstraction for user interfaces in WordPress utilizing [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form).
Expand Down
3 changes: 2 additions & 1 deletion scripts/playground.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ writePlaygroundJson() {
local -n SORTED_PLUGINS=$1
local GIT_COMMIT=$2
local BUNDLE_DIR=$3
local GITHUB_URL="https://raw.githubusercontent.com/IONOS-WordPress/cfhack2024-wp-react-jsonschema-form/playground/$GIT_COMMIT"
local BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
local GITHUB_URL="https://raw.githubusercontent.com/IONOS-WordPress/cfhack2024-wp-react-jsonschema-form/playground/trunk"

echo $SORTED_PLUGINS
echo $GIT_COMMIT
Expand Down

0 comments on commit 82117d9

Please sign in to comment.