diff --git a/.github/workflows/ci-default.yml b/.github/workflows/ci-default.yml index 52d8cb855..ea2969914 100644 --- a/.github/workflows/ci-default.yml +++ b/.github/workflows/ci-default.yml @@ -9,7 +9,7 @@ env: NODE_ENV: ${{ vars.NODE_ENV }} PLASMIC_PROJECT_ID: ${{ vars.PLASMIC_PROJECT_ID }} PLASMIC_PROJECT_API_TOKEN: ${{ vars.PLASMIC_PROJECT_API_TOKEN }} - NEXT_PUBLIC_DOMAIN: ${{ vars.NEXT_PUBLIC_DOMAIN }} + NEXT_PUBLIC_DOMAIN: "www.opensource.observer" NEXT_PUBLIC_DB_GRAPHQL_URL: ${{ vars.NEXT_PUBLIC_DB_GRAPHQL_URL }} OSO_API_KEY: ${{ secrets.OSO_API_KEY }} NEXT_PUBLIC_ALGOLIA_APPLICATION_ID: "test" @@ -108,9 +108,9 @@ jobs: version: nightly-87bc53fc6c874bd4c92d97ed180b949e3a36d78c - name: Authenticate to google with a test-dummy user - uses: 'google-github-actions/auth@v2' + uses: "google-github-actions/auth@v2" with: - credentials_json: '${{ env.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }}' + credentials_json: "${{ env.GOOGLE_TEST_DUMMY_CREDENTIALS_JSON }}" create_credentials_file: true - name: Setup dbt profile @@ -119,7 +119,7 @@ jobs: - name: Run supabase local run: | - bash .github/scripts/run-supabase-local.sh apps/frontend + bash .github/scripts/run-supabase-local.sh apps/frontend - name: Check if algolia is empty, set the variable to some dummy value if it is shell: bash @@ -139,7 +139,7 @@ jobs: - name: Lint run: | - pnpm lint + pnpm lint # Always run this step so that all linting errors can be seen at once. if: always() diff --git a/.github/workflows/deploy-dbt-docs.yml b/.github/workflows/deploy-dbt-docs.yml new file mode 100644 index 000000000..280bbe3ef --- /dev/null +++ b/.github/workflows/deploy-dbt-docs.yml @@ -0,0 +1,68 @@ +# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. +name: deploy-dbt-docs +env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + # Google variables + GOOGLE_PROJECT_ID: "opensource-observer" + +# Trigger the workflow when: +on: + # A push occurs to one of the matched branches. + push: + branches: + - main + paths: + - warehouse/dbt/** + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build-deploy: + # NOTE: This name appears in GitHub's Checks API. + name: build-deploy + environment: deploy + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 9 + run_install: | + - recursive: true + args: [--frozen-lockfile, --strict-peer-dependencies] + + - name: Set up Node.js 20 + uses: actions/setup-node@v3 + with: + cache: "pnpm" + node-version: "20.x" + + - name: "Setup Python, Poetry and Dependencies" + uses: packetcoders/action-setup-cache-python-poetry@main + with: + python-version: 3.12 + poetry-version: 1.7.1 + + - name: Login to google + uses: "google-github-actions/auth@v2" + with: + credentials_json: "${{ secrets.GOOGLE_BQ_ADMIN_CREDENTIALS_JSON }}" + create_credentials_file: true + + - name: Setup dbt profile + run: | + bash .github/scripts/create-dbt-profile.sh ${GOOGLE_APPLICATION_CREDENTIALS} + + - name: Build + run: pnpm build:dbt:docs + + - name: Publish + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + command: pages deploy target --project-name=models-opensource-observer diff --git a/.github/workflows/deploy-docusaurus-docs.yml b/.github/workflows/deploy-docusaurus-docs.yml new file mode 100644 index 000000000..d0ac302cb --- /dev/null +++ b/.github/workflows/deploy-docusaurus-docs.yml @@ -0,0 +1,56 @@ +# NOTE: This name appears in GitHub's Checks API and in workflow's status badge. +name: deploy-docusaurus-docs +env: + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + DOCS_URL: ${{ vars.DOCS_URL }} + DOCS_ALGOLIA_APP_ID: ${{ vars.DOCS_ALGOLIA_APP_ID }} + DOCS_ALGOLIA_API_KEY: ${{ vars.DOCS_ALGOLIA_API_KEY }} + DOCS_ALGOLIA_INDEX: ${{ vars.DOCS_ALGOLIA_INDEX }} + DOCS_SEGMENT_WRITE_KEY: ${{ vars.DOCS_SEGMENT_WRITE_KEY }} + +# Trigger the workflow when: +on: + # A push occurs to one of the matched branches. + push: + branches: + - main + paths: + - apps/docs/** + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build-deploy: + # NOTE: This name appears in GitHub's Checks API. + name: build-deploy + environment: deploy + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 9 + run_install: | + - recursive: true + args: [--frozen-lockfile, --strict-peer-dependencies] + + - name: Set up Node.js 20 + uses: actions/setup-node@v3 + with: + cache: "pnpm" + node-version: "20.x" + + - name: Build + run: pnpm build:docs + + - name: Publish + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + workingDirectory: "apps/docs" + command: pages deploy build --project-name=docs-opensource-observer diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ecd8d16e4..ee2c0fb06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: version: 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/preset-classic': specifier: 3.1.1 - version: 3.1.1(@algolia/client-search@4.23.3)(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3) + version: 3.1.1(@algolia/client-search@4.23.3)(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3) '@docusaurus/theme-common': specifier: 3.1.1 version: 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) @@ -40,10 +40,10 @@ importers: version: 1.0.6 '@mdx-js/react': specifier: ^3.0.0 - version: 3.0.0(@types/react@18.2.79)(react@18.2.0) + version: 3.0.0(@types/react@18.3.3)(react@18.2.0) '@plasmicapp/react-web': specifier: ^0.2.337 - version: 0.2.337(@types/react@18.2.79)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + version: 0.2.337(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) clsx: specifier: ^2.1.0 version: 2.1.0 @@ -4337,8 +4337,8 @@ packages: '@types/react@18.2.64': resolution: {integrity: sha512-MlmPvHgjj2p3vZaxbQgFUQFvD8QiZwACfGqEdDSWou5yISWxDQ4/74nCAwsUiX7UFLKZz3BbVSPj+YxeoGGCfg==} - '@types/react@18.2.79': - resolution: {integrity: sha512-RwGAGXPl9kSXwdNTafkOEuFrTBD5SA2B3iEB96xi8+xu5ddUa/cpvyVCSNn+asgLCTHkb5ZxN8gbuibYJi4s1w==} + '@types/react@18.3.3': + resolution: {integrity: sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==} '@types/readable-stream@2.3.15': resolution: {integrity: sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ==} @@ -13070,14 +13070,14 @@ snapshots: '@docsearch/css@3.5.2': {} - '@docsearch/react@3.5.2(@algolia/client-search@4.23.3)(@types/react@18.2.79)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)': + '@docsearch/react@3.5.2(@algolia/client-search@4.23.3)(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)': dependencies: '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.23.3)(algoliasearch@4.22.1)(search-insights@2.13.0) '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.23.3)(algoliasearch@4.22.1) '@docsearch/css': 3.5.2 algoliasearch: 4.22.1 optionalDependencies: - '@types/react': 18.2.79 + '@types/react': 18.3.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) search-insights: 2.13.0 @@ -13480,7 +13480,7 @@ snapshots: - vue-template-compiler - webpack-cli - '@docusaurus/preset-classic@3.1.1(@algolia/client-search@4.23.3)(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3)': + '@docusaurus/preset-classic@3.1.1(@algolia/client-search@4.23.3)(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3)': dependencies: '@docusaurus/core': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/plugin-content-blog': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) @@ -13491,9 +13491,9 @@ snapshots: '@docusaurus/plugin-google-gtag': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/plugin-google-tag-manager': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/plugin-sitemap': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) - '@docusaurus/theme-classic': 3.1.1(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) + '@docusaurus/theme-classic': 3.1.1(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/theme-common': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) - '@docusaurus/theme-search-algolia': 3.1.1(@algolia/client-search@4.23.3)(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3) + '@docusaurus/theme-search-algolia': 3.1.1(@algolia/client-search@4.23.3)(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3) '@docusaurus/types': 3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -13519,11 +13519,11 @@ snapshots: '@docusaurus/react-loadable@5.5.2(react@18.2.0)': dependencies: - '@types/react': 18.2.64 + '@types/react': 18.3.3 prop-types: 15.8.1 react: 18.2.0 - '@docusaurus/theme-classic@3.1.1(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3)': + '@docusaurus/theme-classic@3.1.1(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3)': dependencies: '@docusaurus/core': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/mdx-loader': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -13537,7 +13537,7 @@ snapshots: '@docusaurus/utils': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) '@docusaurus/utils-common': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) '@docusaurus/utils-validation': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) - '@mdx-js/react': 3.0.0(@types/react@18.2.79)(react@18.2.0) + '@mdx-js/react': 3.0.0(@types/react@18.3.3)(react@18.2.0) clsx: 2.1.0 copy-text-to-clipboard: 3.2.0 infima: 0.2.0-alpha.43 @@ -13607,9 +13607,9 @@ snapshots: - vue-template-compiler - webpack-cli - '@docusaurus/theme-search-algolia@3.1.1(@algolia/client-search@4.23.3)(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.2.79)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3)': + '@docusaurus/theme-search-algolia@3.1.1(@algolia/client-search@4.23.3)(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@types/react@18.3.3)(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0)(typescript@5.3.3)': dependencies: - '@docsearch/react': 3.5.2(@algolia/client-search@4.23.3)(@types/react@18.2.79)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0) + '@docsearch/react': 3.5.2(@algolia/client-search@4.23.3)(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(search-insights@2.13.0) '@docusaurus/core': 3.1.1(@docusaurus/types@3.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) '@docusaurus/logger': 3.1.1 '@docusaurus/plugin-content-docs': 3.1.1(eslint@8.56.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.3.3) @@ -15004,10 +15004,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@mdx-js/react@3.0.0(@types/react@18.2.79)(react@18.2.0)': + '@mdx-js/react@3.0.0(@types/react@18.3.3)(react@18.2.0)': dependencies: '@types/mdx': 2.0.10 - '@types/react': 18.2.79 + '@types/react': 18.3.3 react: 18.2.0 '@metamask/eth-sig-util@4.0.1': @@ -15774,7 +15774,7 @@ snapshots: dependencies: react: 18.2.0 - '@plasmicapp/react-web@0.2.337(@types/react@18.2.79)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + '@plasmicapp/react-web@0.2.337(@types/react@18.3.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@plasmicapp/auth-react': 0.0.21(react@18.2.0) '@plasmicapp/data-sources': 0.1.155(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -15808,7 +15808,7 @@ snapshots: fast-deep-equal: 3.1.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - valtio: 1.13.2(@types/react@18.2.79)(react@18.2.0) + valtio: 1.13.2(@types/react@18.3.3)(react@18.2.0) transitivePeerDependencies: - '@types/react' @@ -17514,7 +17514,7 @@ snapshots: '@types/scheduler': 0.16.8 csstype: 3.1.3 - '@types/react@18.2.79': + '@types/react@18.3.3': dependencies: '@types/prop-types': 15.7.12 csstype: 3.1.3 @@ -19351,9 +19351,9 @@ snapshots: dequal@2.0.3: {} - derive-valtio@0.1.0(valtio@1.13.2(@types/react@18.2.79)(react@18.2.0)): + derive-valtio@0.1.0(valtio@1.13.2(@types/react@18.3.3)(react@18.2.0)): dependencies: - valtio: 1.13.2(@types/react@18.2.79)(react@18.2.0) + valtio: 1.13.2(@types/react@18.3.3)(react@18.2.0) destroy@1.2.0: {} @@ -26059,13 +26059,13 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - valtio@1.13.2(@types/react@18.2.79)(react@18.2.0): + valtio@1.13.2(@types/react@18.3.3)(react@18.2.0): dependencies: - derive-valtio: 0.1.0(valtio@1.13.2(@types/react@18.2.79)(react@18.2.0)) + derive-valtio: 0.1.0(valtio@1.13.2(@types/react@18.3.3)(react@18.2.0)) proxy-compare: 2.6.0 use-sync-external-store: 1.2.0(react@18.2.0) optionalDependencies: - '@types/react': 18.2.79 + '@types/react': 18.3.3 react: 18.2.0 value-equal@1.0.1: {}