Update Data #452
This file contains hidden or 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: Update Data | |
| on: | |
| schedule: | |
| - cron: "0 3 * * *" # 毎日12:00 JST (3:00 UTC)に実行 | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| working-directory: ./packages/hub | |
| jobs: | |
| update-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: "true" | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "lts/*" | |
| cache: "yarn" | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Fetch GA data | |
| env: | |
| GA_SERVICE_ACCOUNT_KEY: ${{ secrets.GA_SERVICE_ACCOUNT_KEY }} | |
| GA_PROPERTY_ID: ${{ secrets.GA_PROPERTY_ID }} | |
| run: node ./scripts/fetch-ga-data.js | |
| - name: Update Tag data | |
| run: node ./scripts/update-tags.mjs | |
| - name: Commit and push if changed | |
| run: | | |
| git config --global user.email "github-actions@example.com" | |
| git config --global user.name "GitHub Actions" | |
| git add -A | |
| git commit -m "Update analytics data" || exit 0 | |
| git push | |
| deploy-data: | |
| needs: update-data | |
| uses: ./.github/workflows/pages.yml |