diff --git a/.github/workflows/update-article-views.yml b/.github/workflows/update-article-views.yml new file mode 100644 index 0000000000..81d692b1eb --- /dev/null +++ b/.github/workflows/update-article-views.yml @@ -0,0 +1,29 @@ +name: Update article views +on: + workflow_dispatch: +# schedule: +# # 12.00 every day +# - cron: "0 0 * * *" +jobs: + execute: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: gp-popular-articles # TODO: remove once merged + fetch-depth: 1 + - uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + - name: Restore cache + uses: actions/cache@v3 + with: + path: "**/node_modules" + key: ${{ runner.os }}-build-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-build- + - name: add tokens to .env + run: | + echo "SANITY_WRITE_KEY=${{ secrets.SANITY_UTILITY_WRITE }}" >> scripts/article-views/.env + - name: Install dependencies + run: deno run --allow-net --allow-read --allow-env --no-config scripts/article-views/update-article-views/main.ts