Backup Djeva #493
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: Backup Djeva | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 14 * * 1-5" | |
jobs: | |
start_run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Codes | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Start Backup | |
run: python main.py | |
- name: Update Djeva | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
if [ -n "$(git status --porcelain)" ]; then | |
git add . | |
git commit -m "update Djeva $(date +'%B %d, %Y %T (%Z)')" | |
git push origin $(git branch --show-current) | |
else | |
echo "Oops, seems push failed!" | |
exit 1 | |
fi |