forked from bavverst/Blue-Bike-to-Linked-GBFS
-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (49 loc) · 1.76 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: BlueBike API publishing
on:
schedule:
- cron: "*/5 * * * *"
repository_dispatch:
types: [push]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
# Checkout repo
- uses: actions/checkout@v2
# Generate RDF using RMLMapper
- run: mkdir -p public/history
- run: wget https://github.com/RMLio/rmlmapper-java/releases/download/v6.0.0/rmlmapper-6.0.0-r363-all.jar
- run: java -jar rmlmapper-6.0.0-r363-all.jar -m mapping-webapi-official.rml.ttl
# History
- run: echo "DATE=$(date '+%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
- run: echo "FILE=$(echo ${{ env.DATE }} | sed 's/-//g' | sed 's/://g')" >> $GITHUB_ENV
- run: cp ./history/bluebike.ttl "./history/${{ env.FILE }}.ttl"
# append to file list.
- run: |
echo "${{ env.DATE }},${{ env.FILE }}.ttl" >> list.csv
# generate root.ttl
- run: java -jar rmlmapper-6.0.0-r363-all.jar -m root.rml.ttl
# make everything public
- run: cp ./history/*.ttl ./public/history/
- run: cp root.ttl ./public/root.ttl
- run: |
# setup the username and email.
git config user.name "Pieter's GitHub Actions Bot"
git config user.email "<[email protected]>"
- run: |
# commit
git add root.ttl
git add list.csv
git add history
git commit -m "history: update ${{ env.DATE }}"
git push origin master
# Execute deployment only on production
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public