Check for Aleph Updates #48
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: Check for Aleph Updates | |
on: | |
schedule: | |
- cron: "23 23 * * 2" # This will run the workflow at 4:00 PM Pacific Time every Tuesday | |
jobs: | |
check_aleph: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install PyYAML requests | |
- name: Download and edit Aleph docker-compose.yml | |
run: python .github/workflows/aleph/download_and_edit_aleph.py | |
- name: Install and authenticate GitHub CLI | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
sudo apt-get install -y gh | |
echo "export GITHUB_TOKEN=$GH_TOKEN" >> $GITHUB_ENV | |
- name: Check for changes and commit to main branch | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "micahbot" | |
git checkout main | |
cp temp_docker-compose.yml chapter-5/aleph/docker-compose.yml | |
git add chapter-5/aleph/docker-compose.yml | |
git diff-index --quiet HEAD || git commit -m "Updating Aleph" | |
git push origin main |