Build from AirTable #672
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 from AirTable | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 10 * * *' | |
jobs: | |
build: | |
name: Build and pull request | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Build | |
run: | | |
npm ci | |
npm run build | |
npm run build:dictionary | |
npm run build:alphabet | |
env: | |
AIRTABLE_API_KEY: ${{ secrets.AIRTABLE_API_KEY }} | |
AZURE_SUBSCRIPTION_KEY: ${{ secrets.AZURE_SUBSCRIPTION_KEY }} | |
AZURE_REGION: ${{ secrets.AZURE_REGION }} | |
- name: Check if there is any change | |
id: changes | |
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT | |
- name: Commit changes | |
if: steps.changes.outputs.changed != 0 | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add data | |
git commit -m "Updated data from AirTable state at `date +'%d.%m %H:%M'`" | |
# https://github.com/marketplace/actions/create-pull-request | |
- name: Create Pull Request | |
if: steps.changes.outputs.changed != 0 | |
uses: peter-evans/create-pull-request@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | |
with: | |
base: main | |
delete-branch: true | |
add-paths: data | |
branch: airtable | |
title: Airtable update | |
reviewers: met,pionl |