Update data from AIS #4900
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 data from AIS | |
on: | |
schedule: | |
- cron: "0 */6 * * *" | |
jobs: | |
fetch: | |
name: Fetch AIS data | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- run: npm install node-fetch where yaml | |
- run: node .github/fetchais.mjs | |
env: | |
AISHUB_TOKEN: ${{secrets.AISHUB_TOKEN}} | |
- run: node .github/updateposition.mjs | |
- name: Commit files | |
run: | | |
if [ -z "$(git status --porcelain)" ]; then exit 0;fi | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add _data/aishub.json | |
git add _data/position.json | |
git commit -m "Updated AIS data" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main |