Skip to content

commit 5

commit 5 #16

Workflow file for this run

name: Sync Query Engine
on:
push:
branches:
- '**'
workflow_dispatch:
jobs:
push-subtrees:
runs-on: ubuntu-latest
steps:
- name: Checkout fullstack
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.1
with:
ssh-private-key: ${{ secrets.QUERY_ENGINE_SUITE_KEY }}
- name: Set Git user
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Set branch name
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Clone suite
run: |
cp -r ./ ../tmp
cd ..
#ls
#ls ./tmp
rm -r ./tmp/.git
git clone git@github.com:OPSILab/query-engine-suite.git
cd query-engine-suite
git remote add qe-remote git@github.com:OPSILab/query-engine.git || echo "Remote already exists"
mv -r ../tmp ./Query-Engine
if git ls-remote --heads origin ${{ env.BRANCH_NAME }} | grep -q ${{ env.BRANCH_NAME }}; then
echo "Branch exists on remote, pushing subtree..."
git push origin ${{ env.BRANCH_NAME }}
else
echo "Branch does not exist on remote, creating branch..."
git push origin HEAD:refs/heads/${{ env.BRANCH_NAME }}
fi