-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (41 loc) · 1.33 KB
/
Copy pathpublishToGHPages.yml
File metadata and controls
48 lines (41 loc) · 1.33 KB
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
name: Publish to Github Pages
on:
push:
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
CLIENT_ID: ${{secrets.CLIENT_ID}}
CLIENT_SECRET: ${{secrets.CLIENT_SECRET}}
REFRESH_TOKEN: ${{secrets.REFRESH_TOKEN}}
jobs:
run:
name: Publish JSON
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v2
with:
node-version: "16.x"
- name: Keep npm cache around to speed up installs
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci --no-audit
- name: Clone data-files from gh-pages branch
run:
git clone https://github.com/Lenakh97/Nordic-strava-application
--branch gh-pages --depth 1 data
- name: Update JSON
run: npx tsx fetch.ts
- name: Summarize JSON
run: npx tsx writeSummarizedData.ts
- name: Commit updated data files
working-directory: data
run: |
echo "machine github.com login accesskey password ${{ secrets.TOKEN }}" > ~/.netrc
git config --global user.email "actions@example.com"
git config --global user.name "GitHub Actions"
git add -A
git commit -m "update JSON"
git push