Skip to content

feat: Integrate ProAffinity-GNN for binding energy prediction #85

feat: Integrate ProAffinity-GNN for binding energy prediction

feat: Integrate ProAffinity-GNN for binding energy prediction #85

Workflow file for this run

name: Sync to Compact Branch
on:
push:
branches: [ main ]
permissions:
contents: write
actions: read
jobs:
sync-compact:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create or checkout compact branch
run: |
# Check if compact branch exists remotely
if git ls-remote --heads origin compact | grep -q compact; then
echo "Compact branch exists, fetching and checking it out"
git fetch origin compact
git checkout -b compact origin/compact
git reset --hard main
else
echo "Creating new compact branch from main"
git checkout -b compact
fi
- name: Remove specified files and folders
run: |
# Remove all .ipynb files recursively
find . -name "*.ipynb" -type f -delete
# Remove docs folder if it exists
if [ -d "docs" ]; then
rm -rf docs
echo "Removed docs folder"
fi
# Remove data folder if it exists
if [ -d "data" ]; then
rm -rf data
echo "Removed data folder"
fi
# Show what was removed
echo "Files and folders removed from compact branch"
- name: Commit and push changes
run: |
# Add all changes (including deletions)
git add -A
# Check if there are any changes to commit
if git diff --staged --quiet; then
echo "No changes to commit"
# Even if no file changes, we still want to sync with main
git push --force origin compact
else
git commit -m "Auto-sync from main: Remove .ipynb files, docs and data folders"
git push --force origin compact
echo "Changes committed and pushed to compact branch"
fi
- name: Force push compact branch
run: |
# Ensure compact branch is exactly what we want
echo "Compact branch successfully synchronized with main (minus excluded files)"