Skip to content

UpdateData

UpdateData #334

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: UpdateData
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
schedule:
- cron: "0 0 * * *"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Install dim
run: curl -L https://github.com/c-3lab/dim/releases/latest/download/x86_64-unknown-linux-gnu-dim -o /usr/local/bin/dim
- name: Grant user execution permission
run: chmod u+x /usr/local/bin/dim
- name: Init dim project
run: dim init
- name: Install shinryoujo data
run: dim install -P https://www.mhlw.go.jp/stf/seisakunitsuite/bunya/0000186912_00002.html -e ".pdf" -n "shinryoujo"
- name: Uninstall without using data
run: dim uninstall shinryoujo_48 && dim uninstall shinryoujo_49
- name: Install ken all
run: dim install https://www.post.japanpost.jp/zipcode/dl/utf/zip/utf_ken_all.zip -p unzip -n "ken_all"
- name: Install jigyosyo
run: dim install https://www.post.japanpost.jp/zipcode/dl/jigyosyo/zip/jigyosyo.zip -p unzip -n "jigyosyo"
- name: Install JPGIS
run: dim install https://nlftp.mlit.go.jp/ksj/gml/data/N03/N03-2024/N03-20240101_GML.zip -p unzip -n "JPGIS2014"
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "3.11.10"
- name: Install Python dependencies
run: pip install tabula-py pandas pdfplumber requests geopandas jageocoder
- name: PDF to CSV
run: python main.py
- name: delete files
run: rm -rf ./data_files/JPGIS2014
- name: Commit data files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git status
git add -f ./data_files dim.json dim-lock.json
git add -f ./output_files
git commit -m "Update data" || echo "Nothing to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
repository: c-3lab/opendata-pdf-to-csv
github_token: ${{ secrets.GITHUB_TOKEN }}