From 30f5d9440762cfbc0be89968de8abacb60b43097 Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Mon, 4 Aug 2025 16:03:00 -0600 Subject: [PATCH 1/4] add gh pages template from docusaurus --- .github/workflows/deploy.yaml | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 00000000..ca63fdfc --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,54 @@ +name: Deploy Docusaurus to GitHub Pages + +on: + pull_request: + push: + branches: + - main + +jobs: + build: + name: Build Docusaurus + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + - name: Install root dependencies + run: npm ci + + - name: Install site dependencies + run: npm run site:install + + - name: Build Docusaurus site + run: npm run site:build + + - name: Upload Build Artifact + uses: actions/upload-pages-artifact@v3 + with: + path: build + + deploy: + name: Deploy to GitHub Pages + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From e85070f9333ebb41f06064b0349ad46f4d4759ba Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Thu, 7 Aug 2025 16:46:02 -0700 Subject: [PATCH 2/4] deploy on a couple additional branches for now, only deploy on those branch updates and not on prs (build only), explicit deploy concurrency safeguard (edge case) and upload the site build for ghp deploy --- .github/workflows/deploy.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index ca63fdfc..b834ee1e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,10 +1,22 @@ name: Deploy Docusaurus to GitHub Pages on: + # Trigger the workflow on pull requests and pushes to specific branches pull_request: push: branches: - main + - docs-in-hdb + - gh-pages-workflow + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these deployments to complete. +# This shouldn't be necessary for most cases, but it can help avoid conflicts if multiple pushes happen in quick succession. +concurrency: + group: "pages" + cancel-in-progress: false jobs: build: @@ -32,11 +44,14 @@ jobs: - name: Upload Build Artifact uses: actions/upload-pages-artifact@v3 with: - path: build + path: site/build deploy: - name: Deploy to GitHub Pages needs: build + name: Deploy to GitHub Pages + runs-on: ubuntu-latest + # Only deploy on push to specific branches, not on PRs + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docs-in-hdb' || github.ref == 'refs/heads/gh-pages-workflow') permissions: pages: write @@ -46,7 +61,6 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest steps: - name: Deploy to GitHub Pages From 6ff0300dac6ed84641a0bac1af53af507ad621c0 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Thu, 7 Aug 2025 16:59:02 -0700 Subject: [PATCH 3/4] add some debug output on build and upload npm logs on failure --- .github/workflows/deploy.yaml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index b834ee1e..1ae5d76c 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -31,15 +31,40 @@ jobs: with: node-version: '22' cache: 'npm' + cache-dependency-path: 'package-lock.json' + + - name: Debug - Show directory structure + run: | + echo "Current directory: $(pwd)" + echo "Repository root contents:" + ls -la + echo "Site directory contents:" + ls -la site/ || echo "Site directory not found" + echo "Looking for package.json files:" + find . -name "package.json" -type f - name: Install root dependencies - run: npm ci + run: | + echo "Installing root dependencies from $(pwd)" + npm ci || (echo "Root npm ci failed, uploading logs" && exit 1) - name: Install site dependencies - run: npm run site:install + run: | + echo "Installing site dependencies..." + npm run site:install || (echo "Site install failed" && exit 1) - name: Build Docusaurus site - run: npm run site:build + run: | + echo "Building Docusaurus site..." + npm run site:build || (echo "Site build failed" && exit 1) + + - name: Upload npm logs on failure + if: failure() + uses: actions/upload-artifact@v4 + with: + name: npm-logs + path: | + ~/.npm/_logs/ - name: Upload Build Artifact uses: actions/upload-pages-artifact@v3 From 4b84891103d3411e1baa62c91813a2bb75af553c Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Thu, 7 Aug 2025 17:06:52 -0700 Subject: [PATCH 4/4] remove wip branch from trigger and allowed deploy list --- .github/workflows/deploy.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 1ae5d76c..54f2077e 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -7,7 +7,6 @@ on: branches: - main - docs-in-hdb - - gh-pages-workflow # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -76,7 +75,7 @@ jobs: name: Deploy to GitHub Pages runs-on: ubuntu-latest # Only deploy on push to specific branches, not on PRs - if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docs-in-hdb' || github.ref == 'refs/heads/gh-pages-workflow') + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/docs-in-hdb') permissions: pages: write