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
13 changes: 11 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: npm
directory: "/"
schedule:
interval: "weekly"
groups:
astro:
patterns:
- "astro"
- "@astrojs/*"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: "weekly"
47 changes: 47 additions & 0 deletions .github/workflows/content-health.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Check production content health

on:
schedule:
- cron: '17 6 * * 1'
workflow_dispatch:

permissions:
contents: read

jobs:
production-drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- name: Compare live site with committed baseline
continue-on-error: true
shell: bash
run: |
set -o pipefail
node scripts/production-baseline/capture.mjs 2>&1 | tee production-drift.txt
- if: always()
uses: actions/upload-artifact@v6
with:
name: production-drift
path: production-drift.txt

external-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run build
- run: node scripts/check-external-links.mjs
- if: always()
uses: actions/upload-artifact@v6
with:
name: external-link-report
path: external-links-report.json
74 changes: 51 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,61 @@
name: Deploy to GitHub Pages
name: Validate and deploy Astro site

on:
pull_request:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
branches: [main]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
name: Deploy to GitHub Pages
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm test
- run: npm run build
- run: node scripts/production-baseline/validate-dist.mjs
- run: npx playwright install --with-deps chromium
- run: npm run test:browser
- if: always()
uses: actions/upload-artifact@v6
with:
node-version: 16

- name: Install dependencies
run: npm install
- name: Build website
run: npm run build
name: playwright-results
path: test-results/
if-no-files-found: ignore

# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: tgrall/actions-gh-pages@624f2a19a84ffa6edecbed7ba9229af40517b364
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: validate
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run build
- uses: actions/configure-pages@v6
- uses: actions/upload-pages-artifact@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build
path: dist
- id: deployment
uses: actions/deploy-pages@v5
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
/node_modules

# Production
/build
/dist

# Generated files
.docusaurus
.cache-loader
.astro
/test-results
/playwright-report
/external-links-report.json

# Misc
.DS_Store
Expand All @@ -16,8 +18,6 @@
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

/wip

Expand Down
97 changes: 84 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,104 @@
# Website
# Tug's Site

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
Personal website and technical blog built with [Astro](https://astro.build/) and deployed as a static site to GitHub Pages.

## Installation
## Requirements

- Node.js 24 or newer
- npm

## Local development

```console
yarn install
npm ci
npm run dev
```

## Local Development
The development server is available at `http://localhost:4321`.

## Content

Blog posts live in `blog/` and use the historical filename convention:

```text
YYYY-MM-DD-post-slug.md
```

The filename defines the permanent public route:

```text
/blog/YYYY/MM/DD/post-slug
```

Changing a post's frontmatter date does not change its URL. Frontmatter is validated by the collection schema in `src/content.config.ts`.

Supported frontmatter includes:

- `title` (required)
- `description`
- `date`
- `image`
- `tags`
- `keywords`
- legacy `categories`, retained as metadata without generating public category pages

Static assets remain in `static/` and are published from the site root.

## Validation

```console
yarn start
# Content and utility tests
npm test

# Type-check and build all static routes
npm run build

# Compare generated routes and content with the captured production contract
node scripts/production-baseline/validate-dist.mjs

# Desktop/mobile smoke, accessibility, and visual regression tests
npm run test:browser
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
Browser tests require Chromium:

## Build
```console
npx playwright install chromium
```

### Production baseline

The committed fixture under `tests/fixtures/production-baseline/` records the live Docusaurus site's routes, semantic content hashes, metadata, links, images, redirects, and RSS/Atom entries.

Normal validation is read-only:

```console
yarn build
node scripts/production-baseline/capture.mjs
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
Refreshing the baseline is an explicit, reviewable operation:

## Deployment
```console
node scripts/production-baseline/capture.mjs --update
```

Never refresh the baseline merely to make a migration test pass. Review and explain every production difference first.

### External links

Historical external links are reported separately and do not block deployment:

```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
node scripts/check-external-links.mjs
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Reviewed historical failures can be documented in `tests/fixtures/external-link-allowlist.json`.

## Deployment

`.github/workflows/publish.yml` validates the full site and deploys the resulting `dist/` artifact with GitHub's official Pages actions after changes reach `main`.

The scheduled content-health workflow reports:

- drift between the live site and the committed production baseline
- unavailable external links
33 changes: 33 additions & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {defineConfig} from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
site: 'https://tgrall.github.io',
output: 'static',
publicDir: './static',
trailingSlash: 'never',
redirects: {
'/copilot-blog': '/blog/tags/coding-with-copilot',
'/blog/2024/12/24/quarkus-uploading-image-to-the-cloud': '/blog/2023/12/24/quarkus-uploading-image-to-the-cloud',
'/markdown-page': '/',
'/docs/intro': '/',
'/docs/tutorial-basics/congratulations': '/',
'/docs/tutorial-basics/create-a-blog-post': '/',
'/docs/tutorial-basics/create-a-document': '/',
'/docs/tutorial-basics/create-a-page': '/',
'/docs/tutorial-basics/deploy-your-site': '/',
'/docs/tutorial-basics/markdown-features': '/',
'/docs/tutorial-extras/manage-docs-versions': '/',
'/docs/tutorial-extras/translate-your-site': '/',
},
integrations: [mdx(), sitemap()],
markdown: {
shikiConfig: {
themes: {
light: 'github-light-high-contrast',
dark: 'github-dark-high-contrast',
},
},
},
});
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Not-authorized
![](http://2.bp.blogspot.com/-wcfWsRgV8Xc/TZ8ypzrBsLI/AAAAAAAAAPE/U9VnHpc3q9M/s200/rest-access.png )
Authorized

If you are not interested to follow steps by step the explanations you can directly jump to the complete [REST Service code](#completeService) or download the full eXo IDE Project from [GitHub](https://github.com/tgrall/sample-gadget-with-security)
If you are not interested to follow steps by step the explanations you can directly jump to the complete [REST Service code](#complete-rest-service) or download the full eXo IDE Project from [GitHub](https://github.com/tgrall/sample-gadget-with-security)

### Access the User Profile from your REST Service

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Couchbase : Create a large dataset using Twitter and Java"

tags: [couchbase, nosql, java, twitter]
---
import Gist from 'react-gist';
import GistEmbed from '../src/components/content/GistEmbed.astro';

An easy way to create large dataset when playing/demonstrating Couchbase -or any other NoSQL engine- is to inject Twitter feed into your database.

Expand Down Expand Up @@ -58,8 +58,7 @@ These keys will be uses in the `twitter4j.properties` file when running the Java

The following code is the main code of the application:

<Gist id="4022377"
/>
<GistEmbed id="4022377" />

Some basic explanation:

Expand Down
Loading
Loading