Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Generate Cred Instance #232

Generate Cred Instance

Generate Cred Instance #232

name: Generate Cred Instance
on:
# Trigger on merging to main.
push:
branches:
- main
# As well as every 24 hours (at 0:00 UTC).
schedule:
- cron: 0 0 * * *
jobs:
GenerateCredInstance:
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max_old_space_size=8192
steps:
- uses: actions/checkout@v3.0.2
with:
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/cache@v2.1.6
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 sourcecred go
yarn sourcecred analysis
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}
cp -r ./{output,data,config,sourcecred.json,package.json,yarn.lock} ./site/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: site