Skip to content

generate-weekly-ranking #51

generate-weekly-ranking

generate-weekly-ranking #51

name: generate-weekly-ranking
on:
schedule:
- cron: '0 15 * * 0'
workflow_dispatch:
jobs:
build:
permissions:
id-token: write
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: scripts/package-lock.json
- name: Install
run: cd ${GITHUB_WORKSPACE}/scripts && npm ci
- name: configure google credentials
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ vars.GCP_IDENTITY_PROVIDER }}
service_account: ${{ vars.GCP_SERVICE_ACCOUNT }}
- name: Generate GA PageView report
id: generate-ga-pv-report
env:
GA_PROPERTY_ID: ${{ secrets.GA_PROPERTY_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_CHANNEL_ID: ${{ vars.MAIN_SLACK_CHANNEL_ID }}
run: |
cd ${GITHUB_WORKSPACE}/scripts
npm run generate:weekly-ranking
- name: Commit and Create Pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "feat: Add PV ranking report"
add-paths: "src/_data"
author: "mameka <[email protected]>"
branch: weekly-ranking-report
delete-branch: true
title: "[auto-review] Update GA Report by github-actions"
body: "Check weekly access ranking report."
reviewers: kudoh
labels: bot