Skip to content

Commit

Permalink
Re-enable docs auto-deployment on main (#1317)
Browse files Browse the repository at this point in the history
Also add a trigger for docs paths/files

Fixes #1316
  • Loading branch information
SchahinRohani authored Sep 4, 2024
1 parent ef3a8a6 commit ca88d90
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@ name: Deploy NativeLink Docs
on:
push:
branches: [main]
paths:
- 'docs/**'
- '**/*.md'
- 'nativelink-config/**'
- 'tools/**'
- '**/*.lock'
- '**/*.nix'
pull_request:
branches: [main]
paths:
- 'docs/**'
- '**/*.md'
- 'nativelink-config/**'
- 'tools/**'
- '**/*.lock'
- '**/*.nix'

permissions: read-all

Expand All @@ -14,9 +28,14 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-24.04, macos-14 ]

name: Docs Deployment / ${{ matrix.os }}
runs-on: ${{ matrix.os }}

permissions:
id-token: write
contents: read

steps:
- name: Checkout
uses: >- # v4.1.1
Expand All @@ -30,23 +49,22 @@ jobs:
uses: >- # v4
DeterminateSystems/magic-nix-cache-action@fc6aaceb40b9845a02b91e059ec147e78d1b4e41
- name: Test deployment on Ubuntu
- name: Test Build on Ubuntu
if: matrix.os == 'ubuntu-24.04' && github.event_name == 'pull_request'
working-directory: docs
run: |
nix develop --impure --command bash -c "
bun staging --project=nativelink-docs --org=nativelink
bun setup && bun docs && bun run build
"
- name: Test deployment on macOS
- name: Test Build on macOS
if: matrix.os == 'macos-14' && github.event_name == 'pull_request'
working-directory: docs
run: |
nix develop --impure --command bash -c "bun setup && bun run build"
- name: Production deployment
if: matrix.os == 'ubuntu-22.04' && github.ref == 'refs/heads/main'
if: matrix.os == 'ubuntu-24.04' && github.ref == 'refs/heads/main'
working-directory: docs
run: |
nix develop --impure --command bash -c "
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This project requires `bun`. The nix flake ships a compatible version.
# Install dependencies with bun.
bun install

# Rebuild the docs reference.
# Rebuild the docs reference. (Note MacOS: Use Bun & Bazel from Host)
bun run docs.build

# Generate the simple parts of the autogenerated docs.
Expand Down

0 comments on commit ca88d90

Please sign in to comment.