Upload GitHub backup #415
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: Upload GitHub backup | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 */2 * *" | |
jobs: | |
backup: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Free up space | |
run: | | |
echo "Before:" | |
df -h | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /usr/local/lib/android | |
sudo rm -rf /opt/ghc | |
sudo rm -rf /opt/hostedtoolcache/CodeQL | |
echo "After:" | |
df -h | |
- name: Install packages | |
run: | | |
sudo apt update | |
sudo apt install python3 python3-distutils git python3-pip curl -y | |
- name: Install Python3 requirements | |
run: | | |
pip3 install -r requirements.txt | |
- name: Execute backup | |
env: | |
LOGURU_COLORIZE: NO | |
YANDEX_TOKEN: ${{ secrets.YANDEX_TOKEN }} | |
GITHUB_ACCESS_TOKEN: ${{ secrets.ACCESS_GITHUB_TOKEN }} | |
run: | | |
python3 backup_github.py --github-token $GITHUB_ACCESS_TOKEN --yd-token $YANDEX_TOKEN -a "user|ZhymabekRoman" -a "org|Silk-Skillet-Jokester" -a "org|Scorebook-Fruit-Seizing" |