metrics #413
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: metrics | |
on: | |
schedule: | |
- cron: '0 16 * * *' | |
workflow_dispatch: | |
env: | |
METRICS_SERVICE_ACCOUNT_JSON: ${{ secrets.METRICS_SERVICE_ACCOUNT_JSON }} | |
jobs: | |
metrics: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: yarn | |
- name: Cache node_modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-memoir-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} | |
restore-keys: | |
${{ runner.os }}-memoir- | |
- name: Install node_modules | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install | |
- name: codegen | |
run: yarn codegen | |
- name: Cache metrics node_modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/yarn | |
key: ${{ runner.os }}-memoir-metrics-${{ hashFiles(format('{0}{1}', github.workspace, '/scripts/send-metrics/yarn.lock')) }} | |
restore-keys: | |
${{ runner.os }}-memoir-metrics | |
- name: Install metrics node_modules | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install | |
working-directory: scripts/send-metrics | |
- name: Create serviceAccount.json file | |
run: echo $METRICS_SERVICE_ACCOUNT_JSON | base64 --decode -i > ./serviceAccount.json | |
working-directory: scripts/send-metrics | |
- name: send metrics | |
run: TZ=Asia/Tokyo yarn send | |
working-directory: scripts/send-metrics |