68 lines (54 loc) · 1.76 KB
/
cron-run.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Build and Release [Weekly]
on:
schedule:
- cron: "0 0 * * 0"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Configure CI Git User
run: |
git config --global user.name 'DecliningLotus'
git config --global user.email 'DecliningLotus@users.noreply.github.com'
- name: Install packages
run: yarn
- name: Fetch API
run: npm explore google-font-metadata -- node ./scripts/api-gen.js $GOOGLE_API_KEY
env:
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
- name: Parse APIv1
run: npm explore google-font-metadata -- yarn parser:v1
- name: Build fonts APIv1
run: yarn build:googlev1
- name: Parse APIv2
run: npm explore google-font-metadata -- yarn parser:v2
- name: Build fonts APIv2
run: yarn build:googlev2
- name: Format files
run: yarn format
- name: Stage changes
run: git add --all
- name: Commit files
run: >-
git commit -m "chore(build): update fontsources $GITHUB_RUN_NUMBER"
continue-on-error: true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Authenticate with Registry
run: |
yarn logout
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish package
run: npm run deploy:ci
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}