Update prices #392
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: Update prices | |
on: | |
workflow_dispatch: # Allow manual trigger | |
inputs: | |
token: # Require the API token as input | |
description: 'API token' | |
required: true | |
jobs: | |
deploy: | |
name: Build and deploy GH pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install npm dependencies | |
run: npm ci | |
- name: Update prices | |
run: node tesla-superchargers update-prices ${{ github.event.inputs.token }} | |
- name: Commit changes back to repo | |
uses: EndBug/add-and-commit@v9 | |
with: | |
message: "Updated pricing data" | |
add: "*.json" | |
- name: Manually invoke render workflow | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: Render pages | |
token: ${{ secrets.PAT }} |