This repository has been archived by the owner on Dec 10, 2023. It is now read-only.
Change cover image #1440
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: Change cover image | |
on: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: "0 */24 * * *" | |
# allows to run the job at any time manually | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r photo/requirements.txt | |
- name: Change the branch | |
run: | | |
cp photo/anime.py /tmp | |
git checkout -B media/cover | |
rm -rf * | |
- name: Pull a random cover from ur Pinterest | |
run: python /tmp/anime.py "${{ secrets.PINTEREST_EMAIL }}" "${{ secrets.PINTEREST_PASSWORD }}" "${{ secrets.PINTEREST_USERNAME }}" | |
- name: Commit new cover | |
run: | | |
git config user.name github-action | |
git config user.email github-actions@github.com | |
git checkout media/cover | |
git add . | |
git commit -am "chore(cover): change cover image" | |
git push -f https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git |