Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Build output
_site/
bin/
*.html
*.pdf
*.epub

# Dependencies
node_modules/
.gem/
vendor/

# Git
.git/
.gitignore

# Editor/IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Temporary files
*.tmp
*.temp
/tmp

# Logs
*.log
npm-debug.log*

# Docker
Dockerfile*
docker-compose*
.dockerignore

# Development
TODO
ATMP-validation-flow.png
OP_RETURN.ipynb
exercise_tutorial-extended_class.ipynb
favicon.ico
22 changes: 22 additions & 0 deletions .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Setup Build Environment'
description: 'Set up Ruby, Node.js, and dependencies for Jekyll site building'

runs:
using: 'composite'
steps:
- name: Install Ruby and Jekyll
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.8'
bundler-cache: true
cache-version: 1
- name: Setup Node.JS 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install mermaid-cli
shell: bash
run: npm install -g @mermaid-js/mermaid-cli
- name: Install bundle dependencies
shell: bash
run: bundle
18 changes: 3 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,10 @@ jobs:
- name: Configure Pages
id: pages
uses: actions/configure-pages@v5
- name: Install Ruby and Jekyll
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
bundler-cache: true
cache-version: 0
- name: Setup Node.JS 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install mermaid-cli
run: npm install -g @mermaid-js/mermaid-cli
- name: Setup Build Environment
uses: ./.github/actions/setup-build
- name: Generate Site
run: |
bundle
make all
run: make all
env:
JEKYLL_ENV: production
ADD_JEKYLL_ARGS: --baseurl "${{ steps.pages.outputs.base_path }}"
18 changes: 3 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,10 @@ jobs:
- name: Configure Pages
id: pages
uses: actions/configure-pages@v5
- name: Install Ruby and Jekyll
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
bundler-cache: true
cache-version: 0
- name: Setup Node.JS 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install mermaid-cli
run: npm install -g @mermaid-js/mermaid-cli
- name: Setup Build Environment
uses: ./.github/actions/setup-build
- name: Generate Site
run: |
bundle
make publish
run: make publish
env:
JEKYLL_ENV: production
ADD_JEKYLL_ARGS: --baseurl "${{ steps.pages.outputs.base_path }}"
Expand Down
File renamed without changes.
75 changes: 34 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
FROM ruby:3.2.2-slim-bookworm

RUN apt update && \
apt --yes upgrade && \
apt --yes install build-essential curl procps git \
fonts-liberation libasound2 \
libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 \
libfontconfig1 libgbm1 libgcc1 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 \
libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \
libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*

ARG UID=1000
ARG GID=1000

WORKDIR /srv/
COPY Gemfile /srv/Gemfile

RUN groupadd -g ${GID} docs && \
useradd -m -u ${UID} -g docs -s /bin/bash docs
RUN chown -R docs:docs /srv/
USER docs

RUN bash -l -c "echo 'export GEM_HOME=${HOME}/.gem' >> ${HOME}/.bashrc \
&& echo 'export GEM_PATH=${HOME}/.gem' >> ${HOME}/.bashrc \
&& source ~/.bashrc \
&& bundle config set --local path ${HOME}/.gem \
&& bundle install"

RUN bash -l -c "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
&& export NVM_DIR=\"\$([ -z \"${XDG_CONFIG_HOME-}\" ] && printf %s \"${HOME}/.nvm\" || printf %s \"${XDG_CONFIG_HOME}/nvm\")\" \
&& [ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\" \
&& echo 'export PATH=${PATH}:/srv/node_modules/.bin' >> ${HOME}/.bashrc \
&& source ~/.bashrc \
&& nvm install node \
&& npm install @mermaid-js/mermaid-cli"

ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENTRYPOINT ["bash", "-l"]
FROM docker.io/library/ruby:3.3.8-alpine

# Install system dependencies
RUN apk add --no-cache \
build-base \
git \
nodejs \
npm \
chromium \
make

# Set chromium path for puppeteer (needed for mermaid diagrams)
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium

# Install latest bundler version
RUN gem install bundler

# Install mermaid-cli globally
RUN npm install -g @mermaid-js/mermaid-cli

WORKDIR /srv

# Copy dependency files first for better caching
COPY Gemfile Gemfile.lock package*.json ./

# Install dependencies
RUN bundle install && npm install

# Ensure bundle bin is in PATH
ENV PATH="/usr/local/bundle/bin:$PATH"

EXPOSE 4000

CMD ["sh", "-c", "bundle install && bundle exec jekyll serve --host 0.0.0.0 --future --drafts --unpublished --incremental --force_polling"]
37 changes: 19 additions & 18 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
source 'https://rubygems.org'

## If you update the version here, also update it in .travis.yml, .ruby-version,
## and README.md. Then push your branch and make sure Travis supports that
## version.
ruby '3.2.2'
## If you update the version here, also update it in Docker and GitHub Actions
ruby '3.3.8'

gem "asciidoctor", "~>2.0.20"
gem "rouge"
gem "asciidoctor", "~>2.0.23"
gem "rouge", "~> 4.4"
gem "csv", "~> 3.3"
gem "base64", "~> 0.2"

## If you add a new Gem below, run `bundle install` to install it.
group :development do
gem "jekyll", "~> 4.3.2"
gem "just-the-docs"
gem 'jekyll-redirect-from'
gem "jekyll", "~> 4.3.4"
gem "just-the-docs", "~> 0.10"
gem 'jekyll-redirect-from', '~> 0.16'
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
#gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
end

group :jekyll_plugins do
gem "asciidoctor-diagram"
gem "jekyll-feed", "~> 0.12"
gem "jekyll-asciidoc", "~> 3.0.0"
gem "asciidoctor-diagram", "~> 2.3"
gem "jekyll-feed", "~> 0.17"
gem "jekyll-asciidoc", "~> 3.0.1"
end

group :asciidoc_plugins do
gem "asciidoctor-epub3"
gem "asciidoctor-pdf"
gem "asciidoctor-epub3", "~> 2.1"
gem "asciidoctor-pdf", "~> 2.3"
gem "rubyzip", "~> 2.3.0"
end

group :testing do
gem 'html-proofer'
gem 'mdl'
gem 'json-schema'
gem 'toml'
gem 'html-proofer', '~> 5.0'
gem 'mdl', '~> 0.13'
gem 'json-schema', '~> 5.0'
gem 'toml', '~> 0.3'
end
Loading