feat: implemented gutenberg color widget #8
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: Updates the gh-pages branch to contain the current trunk | |
on: | |
push: | |
branches: | |
- trunk | |
permissions: | |
contents: write | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
run_install: | | |
- recursive: true | |
args: [--frozen-lockfile, --strict-peer-dependencies] | |
- 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 | |
- name: define Qualified Path | |
run: | | |
- name: Run Playground Script | |
run: | | |
TARGET_DIR="trunk" | |
TARGET_HOST=${GITHUB_REPOSITORY%%/*}/${GITHUB_REPOSITORY##*/} | |
echo "TARGET_DIR=$TARGET_DIR" >> $GITHUB_ENV | |
echo "TARGET_HOST=$TARGET_HOST" >> $GITHUB_ENV | |
./scripts/playground.sh $TARGET_HOST | |
- name: Copy dist folder to gh-pages/trunk | |
run: | | |
# removing the old content if it exists | |
rm -rf gh-pages/$TARGET_DIR | |
# Setting up the target directory | |
echo "Creating gh-pages/$TARGET_DIR" | |
mkdir -p "gh-pages/$TARGET_DIR" | |
echo "copying dist/$TARGET_DIR to gh-pages/$TARGET_DIR" | |
mv dist/$TARGET_DIR $(dirname gh-pages/$TARGET_DIR) | |
# Adding changes to git | |
cd gh-pages | |
git add . | |
git commit -m "Deploying state of PR ${{ github.pr_number}} from ${{ github.head_ref}}" | |
git push origin gh-pages --force | |