Pull Latest Data #172
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: Pull Latest Data | |
on: | |
schedule: | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
inputs: | |
an_input: | |
description: 'Start Workflow ?' | |
required: true | |
default: 'false' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Run Process | |
run: | | |
python process/process.py | |
- name: Commit Files | |
id: commit | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "github-actions" | |
git add --all | |
if [-z "$(git status --porcelain)"]; then | |
echo "::set-output name=push::false" | |
else | |
git commit -m "pull new data" -a | |
echo "::set-output name=push::true" | |
fi | |
shell: bash | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y.%m.%d')" | |
- name: Push changes | |
if: steps.commit.outputs.push == 'true' | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tags: true | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ steps.date.outputs.date }} | |
name: ${{ steps.date.outputs.date }} | |
files: | | |
languages.json | |
languages.csv | |
languages.xml | |
languages.sqlite3.db | |
languages.sql |