From 4d49761933ea9616c4e6878b2a20331e9fa847d2 Mon Sep 17 00:00:00 2001 From: Cameron Yick Date: Sun, 3 Mar 2024 09:43:12 -0500 Subject: [PATCH] test: check if console log shows up on the previw site --- .github/workflows/deployment-preview.yml | 38 ++++++++++++++++++------ src/compile/compile.ts | 2 ++ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deployment-preview.yml b/.github/workflows/deployment-preview.yml index 673329e892..ef65747cc7 100644 --- a/.github/workflows/deployment-preview.yml +++ b/.github/workflows/deployment-preview.yml @@ -1,4 +1,4 @@ -# .github/workflows/preview.yml +# .github/workflows/deployment-preview.yml name: Deploy PR previews on: @@ -8,6 +8,7 @@ on: - reopened - synchronize - closed + # TODO: should this be rerun on new commits? concurrency: preview-${{ github.ref }} @@ -18,7 +19,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 # Copied from a section of release-docs-and-schema.yml - name: Setup Node @@ -27,23 +28,42 @@ jobs: cache: 'yarn' node-version: latest + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' # Not needed with a .ruby-version file + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Install NPM dependencies run: yarn --frozen-lockfile - name: Prebuild website run: yarn presite - - name: Build with Jekyll - uses: actions/jekyll-build-pages@v1 - with: - source: ./site - destination: ./_site + - name: Main site build script. Might need to jekyll install + shell: bash + run: | + # Install bundle dependencies first + pushd site && bundle install && popd + yarn build:jekyll + + # - name: Build with Jekyll + # uses: actions/jekyll-build-pages@v1 + # with: + # source: site + # destination: _site # End copy from a section of release-docs-and-schema.yml + # https://github.com/actions/upload-pages-artifact?tab=readme-ov-file#file-permissions + # - name: Fix permissions + # run: | + # chmod -c -R +r "_site/" | while read line; do + # echo "::warning title=Invalid file permissions automatically fixed::$line" + # done + - name: Deploy preview and post github comment uses: rossjrw/pr-preview-action@v1 with: - source-dir: ./_site/ + source-dir: _site cleanup-preview-docs: if: github.event.action == 'closed' @@ -52,4 +72,4 @@ jobs: - name: Cleanup pr-preview uses: rossjrw/pr-preview-action@v1 with: - source-dir: ./_site/ + source-dir: _site diff --git a/src/compile/compile.ts b/src/compile/compile.ts index 13e76dcaa8..1a05564c7f 100644 --- a/src/compile/compile.ts +++ b/src/compile/compile.ts @@ -70,6 +70,8 @@ export interface CompileOptions { * @returns An object containing the compiled Vega spec and normalized Vega-Lite spec. */ export function compile(inputSpec: TopLevelSpec, opt: CompileOptions = {}) { + console.log('Check if this is the preview site!', inputSpec); + // 0. Augment opt with default opts if (opt.logger) { // set the singleton logger to the provided logger