Skip to content

relative path

relative path #12

name: PR To GitHub Page Repo
on:
push:
branches:
- react-website
jobs:
send-pull-requests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Bundle
run: |
npm i
npm run build
- name: copy Bundle
run: |
mkdir -p $GITHUB_WORKSPACE/artifact
cp dist/*.wasm $GITHUB_WORKSPACE/artifact
cp dist/*.js $GITHUB_WORKSPACE/artifact
cp dist/*.txt $GITHUB_WORKSPACE/artifact
ls $GITHUB_WORKSPACE/artifact >> $GITHUB_STEP_SUMMARY
- name: set up SSH
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa
known_hosts: unnecessary
- name: Send pull-request
run: |
REPOSITORY="partiql.github.io"
FOLDER="bin/$REPOSITORY"
BRANCH_NAME="Update-Playground"
git clone [email protected]:partiql/partiql.github.io.git $FOLDER
echo "clone completed"
cd $FOLDER
ls
# Setup the committers identity.
git config user.email "[email protected]"
git config user.name "PartiQL Team"
# Create a new feature branch for the changes.
git checkout -b $BRANCH_NAME
# Remove Static Folder
rm -r ui/src/static
mkdir ui/src/static
cp $GITHUB_WORKSPACE/artifact/*.wasm ui/src/static
cp $GITHUB_WORKSPACE/artifact/*.js ui/src/static
cp $GITHUB_WORKSPACE/artifact/playground.js.LICENSE.txt ui/playground.js.LICENSE.txt
# Commit the changes and push the feature branch to origin
git add .
git commit -m "update playground"
git push origin $BRANCH_NAME
gh pr create \
--body "Port From ${{ github.head_ref }}. Commit: ${{ github.sha }}" \
--title "Update Playground" \
--head "$BRANCH_NAME" \
--base "main"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}