Skip to content

Generate Cred Instance #725

Generate Cred Instance

Generate Cred Instance #725

name: Generate Cred Instance
on:
# Trigger on merging to master.
push:
branches:
- master
# As well as every 24 hours (at 0:00 UTC).
schedule:
- cron: 0 0 * * *
jobs:
GenerateCredInstance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false # Required to make github pages deployment work correctly
- uses: actions/setup-node@v3.6.0
with:
node-version: "16"
- name: Cache Data # Cache SourceCred Data, invalidating if any of the config changes or the SC version is updated
uses: actions/cache@v3
with:
path: "**/cache"
key: SC-${{ runner.os }}-V3-${{ hashFiles('**/config.json', '**/sourcecred.json', '**/yarn.lock') }}
- name: Install Packages 🔧
run: |
yarn --frozen-lockfile
- name: Load Data and Compute Cred 🧮
run: |
yarn load
mkdir -p output/contributions/sourcecred/discord
yarn sourcecred contributions
yarn sourcecred credequate
node scripts/wolf-turtle-bear.js
env:
SOURCECRED_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SOURCECRED_DISCORD_TOKEN: ${{ secrets.SOURCECRED_DISCORD_TOKEN }}
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Generate Frontend 🏗
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
yarn sourcecred site
rm -rf ./site/{output,data,config,sourcecred.json}
cp -r ./{output,data,config,sourcecred.json,package.json} ./site/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: site
SINGLE-COMMIT: true