Automated - Update accessibility data #281
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: Automated - Update accessibility data | |
'on': | |
schedule: | |
- cron: '0 2 * * *' | |
jobs: | |
get_data_and_commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{secrets.STATS_PAT}} | |
ref: 'main' | |
- name: Create env file | |
run: | | |
touch .env.secrets | |
echo DATA_SA_KEY=${{ secrets.DATA_SA_KEY }} >> .env.secrets | |
echo DATA_PROJECT_ID=${{ secrets.DATA_PROJECT_ID }} >> .env.secrets | |
echo DATA_STORAGE_BUCKET=${{ secrets.DATA_STORAGE_BUCKET }} >> .env.secrets | |
echo DATA_STORAGE_FILE=${{ secrets.DATA_STORAGE_FILE }} >> .env.secrets | |
- name: Update accessibility data | |
run: 'npm ci && npm run update-accessibility-data' | |
- name: Check if there are any changes | |
id: verify_diff | |
run: git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit & push data | |
if: steps.verify_diff.outputs.changed == 'true' | |
run: | | |
git config --global user.name 'Appt Stats' | |
git config --global user.email '167291111+stats-appt-org@users.noreply.github.com' | |
git add . | |
git commit -am "Automated accessibility data update" | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.STATS_PAT }} |