updated reindex on merge

This commit is contained in:
2025-06-06 17:56:14 -05:00
parent 4f1b8dfe6e
commit 7b8cafc184
+10 -18
View File
@@ -17,56 +17,48 @@ jobs:
# This tells GitHub to run this job on one of your self-hosted runners. # This tells GitHub to run this job on one of your self-hosted runners.
runs-on: Windows runs-on: Windows
# Set a default shell for all run steps in the job. # *** KEY CHANGE ***
# Set the default shell to PowerShell, which is native to your Windows runner.
defaults: defaults:
run: run:
shell: bash shell: pwsh
steps: steps:
# Step 1: Check out the repository's code # Step 1: Check out the repository's code
# This downloads the latest version of your 'main' branch into the runner's working directory.
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
# Step 2: Set up a specific Python version # Step 2: Set up a specific Python version
# This ensures a consistent Python version is used for the venv.
- name: Set up Python 3.11 - name: Set up Python 3.11
id: setup-python id: setup-python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.11' python-version: '3.11'
# Step 3: Create and activate a virtual environment # Step 3: Create and activate a virtual environment (using PowerShell syntax)
# This creates a '.venv' directory in your project folder if it doesn't exist,
# and then activates it for subsequent steps.
- name: Create and activate virtual environment - name: Create and activate virtual environment
run: | run: |
if [ ! -d ".venv" ]; then if (-not (Test-Path -Path ".venv")) {
python -m venv .venv python -m venv .venv
fi }
source .venv/bin/activate # The activation command is different for PowerShell
.\.venv\Scripts\Activate.ps1
# Step 4: Install or update dependencies # Step 4: Install or update dependencies
# This uses the pip from the virtual environment to install all required libraries.
- name: Install dependencies - name: Install dependencies
run: | run: |
source .venv/bin/activate # The venv is now active for this shell session, so we can call pip directly.
pip install --upgrade pip pip install --upgrade pip
pip install -r requirements.txt pip install -r requirements.txt
# Step 5: Run the indexing script within the virtual environment # Step 5: Run the indexing script within the virtual environment
# It executes your 'create_index.py' script using the Python from the venv.
# The GITHUB_TOKEN is still passed securely to the script.
- name: Run indexing script - name: Run indexing script
run: | run: |
source .venv/bin/activate # Call python directly, as the correct one is now on the PATH from the activated venv.
python create_index.py python create_index.py
env: env:
GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Optional: Specify the working directory if your bot lives in a subfolder # Optional: Specify the working directory if your bot lives in a subfolder
# working-directory: ./path/to/your/bot # working-directory: ./path/to/your/bot
# The "Upload database artifact" step is no longer needed, as the database
# is now being written directly to a persistent location on your server.