UpdateData #667
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: UpdateData | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.x' | |
- name: download latest files | |
run: python3 ./scripts/download_latest.py | |
- name: install pandas | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install pandas | |
- name: process usage files | |
run: python3 ./scripts/combine_usage.py | |
- name: check for changes | |
run: git status | |
- name: commit changed files | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
git diff-index --quiet HEAD || git commit -m "Auto updating toonlibraries files" | |
- name: fetch from main | |
run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* | |
- name: push code to main | |
run: git push origin HEAD:main | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Publish github pages | |
run: | | |
npm install gh-pages -g | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
gh-pages -d dist -b gh-pages -u "github-actions-bot <support+actions@github.com>" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |