Redeploy Naisjob (update-article-views) #2
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: 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: Run script | |
run: deno run --allow-net --allow-read --allow-env --no-config scripts/article-views/update-article-views/main.ts | |
- uses: nais/docker-build-push@v0 | |
id: docker-push | |
with: | |
team: designsystem | |
push_image: true | |
dockerfile: scripts/article-views/Dockerfile | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
- name: start naisjob dev-gcp | |
uses: nais/deploy/actions/deploy@master | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
RESOURCE: scripts/naisjob.yaml | |
CLUSTER: dev-gcp | |
IMAGE: ${{ steps.docker-push.outputs.image }} |