-
Notifications
You must be signed in to change notification settings - Fork 7
78 lines (68 loc) · 2.48 KB
/
apis-guru.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: APIs Guru Ratings
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * *
jobs:
generate:
name: Update API Ratings
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"
- run: npm ci
- run: npm run build
# Do this right before the script as the checkout takes a bit of time
# and we dont want the token to expire before we use it.
- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
with:
token_format: "access_token"
workload_identity_provider: projects/196494084534/locations/global/workloadIdentityPools/github-actions-wi-pool/providers/github-actions-wi-provider
service_account: "[email protected]"
access_token_lifetime: 3600
- run: node apis-guru.mjs
working-directory: apps/api
timeout-minutes: 30
env:
GOOGLE_CLOUD_STORAGE_BUCKET: rate-my-open-api-prod
GOOGLE_CLOUD_PROJECT_ID: zuplo-marketing
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
RUN_ID: ${{github.run_id}}
- run: node apis-guru.ratings.mjs
working-directory: apps/api
if: always()
env:
RUN_ID: ${{github.run_id}}
- uses: actions/upload-artifact@v3
if: always()
with:
name: logs
path: apis-guru
# Reauthenticate to Google Cloud because its possible this job takes
# more than 1 hour to run and we want to make sure we save any updates
- name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
if: always()
with:
token_format: "access_token"
workload_identity_provider: projects/196494084534/locations/global/workloadIdentityPools/github-actions-wi-pool/providers/github-actions-wi-provider
service_account: "[email protected]"
access_token_lifetime: 3600
- name: Upload Ratings
if: always()
uses: "google-github-actions/upload-cloud-storage@v1"
with:
path: apis-guru
destination: rate-my-openapi-public/apis-guru
parent: false
headers: |-
content-type: application/json
cache-control: no-cache