Skip to content

Commit

Permalink
hotfix: clean path copy
Browse files Browse the repository at this point in the history
fixed "can not stat /*" issue.
  • Loading branch information
Lukerten committed Aug 7, 2024
1 parent a37ee2c commit 4fc4dca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/playground-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,19 @@ jobs:
run: |
TARGET_DIR="pr/${{ github.head_ref}}/${GITHUB_SHA}"
TARGET_HOST=${GITHUB_REPOSITORY%%/*}/${GITHUB_REPOSITORY##*/}
echo "TARGET_DIR=$TARGET_DIR" >> $GITHUB_ENV
echo "GITHUB_SHA=$GITHUB_SHA" >> $GITHUB_ENV
./scripts/playground.sh $TARGET_HOST $TARGET_DIR
# this produces a dist/$TARGET_DIR folder. we want to move this to gh-pages/$TARGET_DIR

- name: move dist folder
run: |
# Setting up the target directory
echo "Creating gh-pages/$TARGET_DIR"
mkdir -p "gh-pages/$TARGET_DIR"
mv "dist/$TARGET_DIR" $(dirname "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 .
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/playground-trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,25 @@ jobs:
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: |
# Setting up the target directory
BRANCH_NAME=${GITHUB_REF_NAME}
mkdir -p "gh-pages/${BRANCH_NAME}"
cp -r "dist/${BRANCH_NAME}" "gh-pages"
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 ${GITHUB_REF_NAME}"
git commit -m "Deploying state of PR ${{ github.pr_number}} from ${{ github.head_ref}}"
git push origin gh-pages --force

0 comments on commit 4fc4dca

Please sign in to comment.