Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ccerv1 committed May 24, 2024
2 parents 93c8bc7 + 578f0ae commit e17bb07
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 30 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()

Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/deploy-dbt-docs.yml
Original file line number Diff line number Diff line change
@@ -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
56 changes: 56 additions & 0 deletions .github/workflows/deploy-docusaurus-docs.yml
Original file line number Diff line number Diff line change
@@ -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
50 changes: 25 additions & 25 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e17bb07

Please sign in to comment.