build #573
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 | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 3 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Builder | |
uses: actions/checkout@v4 | |
with: | |
path: build | |
ref: build | |
- name: Checkout Data | |
uses: actions/checkout@v4 | |
with: | |
path: data | |
ref: master | |
- name: Parse | |
run: | | |
cd build | |
yarn install | |
yarn add qqwry.ipdb | |
yarn build | |
- name: Push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd ./data | |
cp ../build/data/cncity/* ./data/cncity/ | |
cp ../build/data/country/* ./data/country/ | |
cp ../build/data/special/* ./data/special/ | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "No changes to the output on this push; exiting." | |
exit 0 | |
fi | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "[email protected]" | |
git add . | |
git commit -m "[auto] $(date '+%Y-%m-%d %H:%M:%S')" | |
git push |