Automate Spond Login and Booking #23
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: Automate Spond Login and Booking | |
on: | |
schedule: | |
- cron: '59 19 * * 0' # Runs at 19:59 every Sunday | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Chrome | |
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 | |
- name: Install ChromeDriver | |
run: | | |
CHROME_VERSION=$(google-chrome --version | grep -oP '\d+' | head -1) | |
echo "Detected Chrome version: $CHROME_VERSION" | |
CHROMEDRIVER_VERSION=$(wget -qO- "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION") | |
echo "Detected ChromeDriver version: $CHROMEDRIVER_VERSION" | |
wget -q https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip | |
unzip -o chromedriver_linux64.zip | |
sudo mv chromedriver /usr/bin/chromedriver | |
sudo chown root:root /usr/bin/chromedriver | |
sudo chmod +x /usr/bin/chromedriver | |
- name: Installed package list | |
run: apt list --installed | |
- name: Install all necessary packages | |
run: pip install -r requirements.txt | |
- name: Run script | |
env: | |
MY_EMAIL: ${{ secrets.MY_EMAIL }} | |
MY_PASSWORD: ${{ secrets.MY_PASSWORD }} | |
run: python main.py |