Skip to content

Commit 2644282

Browse files
Merge pull request #23 from davidjpeacock/main
dev: add automated build process
2 parents 8e3c6cf + b75d8cf commit 2644282

8 files changed

Lines changed: 77 additions & 2322 deletions
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
16+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17+
concurrency:
18+
group: "pages"
19+
cancel-in-progress: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Ruby
30+
uses: ruby/setup-ruby@v1
31+
with:
32+
ruby-version: '3.2'
33+
bundler-cache: true
34+
35+
- name: Install dependencies
36+
run: bundle install
37+
38+
- name: Build documentation
39+
run: make html
40+
41+
- name: Upload artifact
42+
uses: actions/upload-pages-artifact@v3
43+
with:
44+
path: ./build
45+
46+
deploy:
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
runs-on: ubuntu-latest
51+
needs: build
52+
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
# Ruby
55
Gemfile.lock
66
.bundle/
7+
8+
# Build output
9+
build/
10+
docs/

CLAUDE.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ make help
3030
```
3131

3232
Output locations:
33-
- **HTML**: `docs/index.html`
34-
- **Images**: `docs/images/` (SVG files automatically copied during build)
33+
- **HTML**: `build/index.html`
34+
- **Images**: `build/images/` (SVG files automatically copied during build)
3535

3636
## Documentation Structure
3737

@@ -52,7 +52,7 @@ The documentation uses AsciiDoc format with the following structure:
5252
- `reference-role-*.adoc` - Ansible role reference documentation
5353
- `images/` - Static SVG workflow diagrams
5454
- `*.svg` - VMware migration workflow diagrams
55-
- `docs/` - Build output directory (generated, not in source control)
55+
- `build/` - Build output directory (generated, not in source control)
5656

5757
### Key Documentation Features
5858
- Single-page HTML generation
@@ -70,19 +70,29 @@ The build process is straightforward:
7070
### HTML Build
7171
- Uses `index.adoc` as the source document
7272
- Builds single-page HTML with all content
73-
- Output: `docs/index.html`
74-
- Automatically copies SVG images from `images/` to `docs/images/`
73+
- Output: `build/index.html`
74+
- Automatically copies SVG images from `images/` to `build/images/`
7575

7676
## Development Workflow
7777

7878
When working with documentation:
7979

8080
1. Source files use AsciiDoc format (.adoc)
81-
2. Build output goes to the `docs/` directory
81+
2. Build output goes to the `build/` directory
8282
3. Static SVG images are automatically copied during build
8383
4. Use `make clean` to reset build state
8484
5. Edit `index.adoc` to control what content is included
8585

86+
### CI/CD Pipeline
87+
88+
Documentation is automatically built and deployed to GitHub Pages when changes are pushed to the `main` branch:
89+
90+
- **Workflow**: `.github/workflows/build-and-deploy.yml`
91+
- **Trigger**: Push to `main` branch or manual workflow dispatch
92+
- **Build**: Uses Ruby 3.2, installs dependencies via Bundler, runs `make html`
93+
- **Deploy**: Uploads build artifacts from `build/` directory to GitHub Pages
94+
- **URL**: Deployed to the repository's GitHub Pages URL
95+
8696
## Important Notes for Code Assistance
8797

8898
### File Path Patterns

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ASCIIDOCTOR = asciidoctor
55

66
# Source and output directories
77
SRC_DIR = .
8-
HTML_OUTPUT_DIR = docs
8+
HTML_OUTPUT_DIR = build
99
IMAGE_SRC_DIR = images
1010

1111
# Main document

docs/images/osm-migration-nbdkit-vmware-workflow-with-osm.drawio.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/images/osm-migration-nbdkit-vmware-workflow-with-osm_cbt_step1.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/images/osm-migration-nbdkit-vmware-workflow-with-osm_cbt_step2.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/index.html

Lines changed: 0 additions & 2303 deletions
This file was deleted.

0 commit comments

Comments
 (0)