-
Notifications
You must be signed in to change notification settings - Fork 15
62 lines (54 loc) · 2.08 KB
/
generate-instance-main.yml
File metadata and controls
62 lines (54 loc) · 2.08 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Generate Instance Main
on:
# A new interval every Sunday.
schedule:
- cron: 5 17 * * 0 # 00:05 UTC, 16:05 PST
# Adds a button to manually trigger
workflow_dispatch:
jobs:
generate-instance-main:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=8192
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ADMIN_TOKEN }}
- name: Install Packages 🔧
run: |
yarn --frozen-lockfile
- name: Load Data and Compute Cred 🧮
run: yarn sourcecred go
env:
SOURCECRED_GITHUB_TOKEN: ${{ secrets.SOURCECRED_GITHUB_TOKEN }}
SOURCECRED_DISCORD_TOKEN: ${{ secrets.SOURCECRED_DISCORD_TOKEN }}
- name: Set environment variables
id: details
run: |
echo "COMMIT_TITLE=Scheduled aliases update for week ending $(date +"%B %dth, %Y")" >> $GITHUB_ENV
description="This commit was auto-generated on $(date +%d-%m-%Y)
to add the latest aliases to our instance."
description="${description//'%'/'%25'}"
description="${description//$'\n'/'%0A'}"
description="${description//$'\r'/'%0D'}"
echo "::set-output name=commit_body::$description"
- name: Commit ledger changes
run: |
git config user.name 'credbot'
git config user.email 'credbot@users.noreply.github.com'
git add data/ledger.json
git add config
git commit --allow-empty -m '${{ env.COMMIT_TITLE }}' -m '${{ steps.details.outputs.commit_body }}'
- name: Push Ledger
run: git push
- name: Generate Frontend 🏗
run: |
yarn sourcecred site
rm -rf ./site/{output,data,config,sourcecred.json,package.json,yarn.lock,cache,.gitignore}
cp -r ./{output,data,config,sourcecred.json,package.json,yarn.lock,cache,.gitignore} ./site/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.3.2
with:
token: ${{ secrets.SOURCECRED_GITHUB_TOKEN }}
branch: cache-archive
folder: site