Skip to content
Draft
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
35 changes: 23 additions & 12 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
name: Build PRs for LoopBack.io site
# Inspired by: https://github.com/actions/starter-workflows/blob/1035244887e26fbbd4f1017d919fb5995cc521c4/pages/jekyll.yml
name: Build LoopBack.io website

on:
pull_request:
branches:
- gh-pages
workflow_dispatch:
branches:
- gh-pages


permissions: {}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
- uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
disable-sudo-and-containers: true
egress-policy: block
allowed-endpoints: >
github.com:443
index.rubygems.org:443
raw.githubusercontent.com:443
registry.npmjs.org:443
rubygems.org:443

- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: Use Node.js 22
- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.18.0

- name: Set up Ruby 3.2
- name: Set up Ruby
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
with:
ruby-version: 3.4.10
bundler-cache: true

- name: Install and Build 🔧
- name: Install and Build
run: |
bundle install
npm install
npm ci --ignore-scripts
npm run postinstall
npm ls @loopback/docs 2>/dev/null || true
npm run build
105 changes: 85 additions & 20 deletions .github/workflows/site-build.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,108 @@
name: Build and Deploy LoopBack.io site
# Inspired by: https://github.com/actions/starter-workflows/blob/1035244887e26fbbd4f1017d919fb5995cc521c4/pages/jekyll.yml
name: Build and Deploy LoopBack.io website

on:
push:
branches:
- gh-pages
workflow_dispatch:
branches:
- gh-pages
workflow_dispatch: {}

permissions: {}

# 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 production
# deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout 🛎️
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
persist-credentials: false
disable-sudo-and-containers: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
index.rubygems.org:443
raw.githubusercontent.com:443
registry.npmjs.org:443
rubygems.org:443

- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Use Node.js 22
- name: Use Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.18.0

- name: Set up Ruby 3.2
- name: Set up Ruby
uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
with:
ruby-version: 3.4.10
bundler-cache: true

# Used merely to expose the GitHub Pages base path for Jekyll to use.
# The website doesn't fully-support custom base paths, but this should
# ease development on forks.
- name: Setup Pages
id: pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0

- name: Install and Build 🔧
- name: Install and Build
run: |
bundle install
npm install
npm ci --ignore-scripts
npm run postinstall
npm ls @loopback/docs 2>/dev/null || true
npm run build

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
npm run build -- --baseurl "${{ steps.pages.outputs.base_path }}"

# Convenience wrapper around `actions/upload-artifact`
# Automatically uploads the './_site' directory as the `github-pages`
# artifact.
- name: Upload Artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0

- name: Push Changes
run: |
git add --all
if [ "$(git status -s)"! = "" ]; then
echo "Vendored assets updated. Pushing changes..."
git commit -sm 'chore: update vendored assets'
git push
else
echo "Vendored assets unchanged. Skipping push."
fi
deploy:
permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

needs: [build]

steps:
- uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
branch: gh-pages
folder: .
egress-policy: audit
allowed-endpoints: >
api.github.com:443
github.com:443

# Convenience wrapper around `actions/download-artifact` and
# `actions/upload-pages-artifact`.
- name: Deploy to Github Pages
id: deployment
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.0.5
14 changes: 13 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "jekyll", "~> 3.10"

# Jekyll Ruby 3.0 compatibility
gem "webrick", "~> 1.9", ">= 1.9.2"

# Jekyll Ruby 4.0 compatibility
gem "logger", "~> 1.7"
gem "base64", "~> 0.3.0"
gem "bigdecimal", "~> 4.1"

# Jekyll plugins
gem "jekyll-sitemap", "~> 1.4"
gem "jekyll-redirect-from", "~> 0.16.0"
gem "jekyll-relative-links", "~> 0.7.0"
gem "kramdown-parser-gfm", "~> 1.1"
Loading