-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (55 loc) · 1.95 KB
/
generate-instance.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
name: Generate Cred Instance
on:
# Trigger on merging to master.
push:
branches:
- main
# As well as every 24 hours (at 0:00 UTC).
schedule:
- cron: 0 17 * * *
workflow_dispatch:
jobs:
GenerateCredInstance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'gh-pages'
- name: Remove old cache from gh-pages branch
run: |
rm -r -f cache ||:
git config user.name 'credbot'
git config user.email '[email protected]'
git add .
git commit --amend --no-edit
git push --force-with-lease
- uses: actions/checkout@v2
with:
ref: 'main'
persist-credentials: false # Required to make github pages deployment work correctly
- name: Cache Data # Cache SourceCred Data, invalidating if any of the config changes or the SC version is updated
uses: actions/[email protected]
with:
path: '**/cache'
key: SC-${{ runner.os }}-${{ hashFiles('**/config.json', '**/sourcecred.json', '**/yarn.lock') }}
- name: Install Packages 🔧
run: yarn --frozen-lockfile
- name: Load Data and Compute Cred 🧮
run: |
yarn load
yarn sourcecred contributions
yarn sourcecred credequate
env:
SOURCECRED_GITHUB_TOKEN: ${{ secrets.SOURCECRED_GITHUB_TOKEN }}
SOURCECRED_DISCORD_TOKEN: ${{ secrets.SOURCECRED_DISCORD_TOKEN }}
- name: Generate Frontend 🏗
run: |
yarn sourcecred site
rm -rf ./site/{output,data,config,sourcecred.json,package.json,yarn.lock,cache}
cp -r ./{output,data,config,sourcecred.json,package.json,yarn.lock,cache} ./site/
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
token: ${{ secrets.SOURCECRED_GITHUB_TOKEN }}
branch: gh-pages
folder: site