Build README #138502
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: Build README | |
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: "*/5 * * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8] | |
steps: | |
- name: ๐ Checkout Repo | |
uses: actions/checkout@v2 | |
- name: ๐ Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: ๐ Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install colorama | |
pip install requests | |
pip install pytz | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: ๐ Build README | |
env: | |
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: python update.py | |
- name: โณ Commit Update | |
run: |- | |
cp -f README.md /tmp/README.md | |
cp -f header.svg /tmp/header.svg | |
cp -f README_TEMPLATE.md /tmp/README_TEMPLATE.md | |
cp -f update.py /tmp/update.py | |
mv -f assets /tmp/assets | |
mv -f lib /tmp/lib | |
mv -f .github /tmp/.github | |
git fetch --all | |
git checkout --progress --force -B main refs/remotes/origin/main | |
mv -f /tmp/README.md README.md | |
mv -f /tmp/header.svg header.svg | |
mv -f /tmp/README_TEMPLATE.md README_TEMPLATE.md | |
mv -f /tmp/update.py update.py | |
rm -rf assets | |
rm -rf .github | |
rm -rf lib | |
mv -f /tmp/assets assets | |
mv -f /tmp/lib lib | |
mv -f /tmp/.github .github | |
git add . | |
git diff | |
git config --global user.email "anonymous@github.com" | |
git config --global user.name "Belikhun Bot" | |
git commit -m "[GA Build $GITHUB_RUN_NUMBER] ๐ฎ README.md: Update README" -m "Commit $GITHUB_SHA by $GITHUB_ACTOR" -m "Ref: $GITHUB_REF" | |
git push |