-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
48 lines (41 loc) · 2.25 KB
/
sync-orama.yml
File metadata and controls
48 lines (41 loc) · 2.25 KB
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
# Security Notes
# This workflow uses `pull_request_target`, so will run against all PRs automatically (without approval), be careful with allowing any user-provided code to be run here
# Only selected Actions are allowed within this repository. Please refer to (https://github.com/nodejs/nodejs.org/settings/actions)
# for the full list of available actions. If you want to add a new one, please reach out a maintainer with Admin permissions.
# REVIEWERS, please always double-check security practices before merging a PR that contains Workflow changes!!
# AUTHORS, please only use actions with explicit SHA references, and avoid using `@master` or `@main` references or `@version` tags.
# MERGE QUEUE NOTE: This Workflow does not run on `merge_group` trigger, as this Workflow is not required for Merge Queue's
name: Sync Orama Cloud
on:
workflow_dispatch:
push:
branches:
- main
pull_request_target:
branches:
- main
types:
- labeled
permissions:
contents: read
jobs:
sync-orama-cloud:
name: Sync Orama Cloud
runs-on: ubuntu-latest
# This Job should run either on non-`pull_request_target` events,
# or `pull_request_target` event with a `labeled` action with a label named `github_actions:pull-request`
# since we want to run Website Builds on all these occasions. As this allows us to be certain the that builds are passing
if: github.event_name != 'pull_request_target' || github.event.label.name == 'github_actions:pull-request'
steps:
- uses: nodejs/web-team/actions/setup-environment@9f3c83af227d721768d9dbb63009a47ed4f4282f
with:
pnpm: true
use-version-file: true
- name: Sync Orama Cloud
working-directory: apps/site
run: node --run sync-orama
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_ORAMA_PROJECT_ID: ${{ github.event_name == 'push' && secrets.NEW_ORAMA_PRODUCTION_PROJECT_ID || secrets.NEW_ORAMA_PROJECT_ID }}
NEW_ORAMA_PRIVATE_API_KEY: ${{ github.event_name == 'push' && secrets.NEW_ORAMA_PRODUCTION_PRIVATE_API_KEY || secrets.NEW_ORAMA_PRIVATE_API_KEY }}
NEW_ORAMA_DATASOURCE_ID: ${{ github.event_name == 'push' && secrets.NEW_ORAMA_PRODUCTION_DATASOURCE_ID || secrets.NEW_ORAMA_DATASOURCE_ID }}