fix: ajustar configuración de GitHub Actions y script principal #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fotocasa Scraper CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 9 * * 1" # Ejecutar todos los lunes a las 9:00 UTC | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Install Chrome and Chromedriver | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget | |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
sudo apt install -y ./google-chrome-stable_current_amd64.deb | |
sudo apt-get install -y chromium-browser chromium-chromedriver | |
- name: Verify Chromium and Chromedriver | |
run: | | |
echo "Chromium binary:" | |
which chromium | |
chromium --version | |
echo "Chromedriver binary:" | |
which chromedriver | |
chromedriver --version | |
- name: Create symlinks (if necessary) | |
run: | | |
sudo ln -s /snap/bin/chromium /usr/bin/google-chrome || echo "Symlink already exists" | |
sudo ln -s /usr/bin/chromedriver /usr/local/bin/chromedriver || echo "Symlink already exists" | |
- name: Run Python script | |
run: python main.py |