-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add books I read on vacation * Please build * It builds locally, will it build on GitHub? * jpeg -> jpg * Tweak * wtf * fff * Will it build * Fuck * Add post about sucky Dash Carts * Ditch pointless remark-kroki fork * Add additional dig about size of sensor package * Brave new container world * Add key to cache action * Pull builder, fix build command * Pull Kroki separately * Pull Kroki too, not just its deps * Log in to ghcr.io
- Loading branch information
Showing
15 changed files
with
4,588 additions
and
2,046 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build blog | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
# Allow this job to clone the repo and create a page deployment | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
TZ: America/Chicago | ||
steps: | ||
- name: Checkout your repository using git | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Cache dependencies | ||
id: cache-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ runner.os }}-node-modules | ||
path: node_modules | ||
|
||
- name: Pull Kroki containers | ||
run: docker compose pull kroki blockdiag mermaid bpmn excalidraw | ||
|
||
- name: Try to pull builder | ||
run: docker compose pull astro || true | ||
|
||
- name: Build and maybe push builder | ||
uses: docker/build-push-action@v5 | ||
with: | ||
cache-to: type=inline | ||
pull: true | ||
push: ${{ github.event_name == 'push' }} | ||
tags: ghcr.io/jordemort/jordemort-blog-builder:latest | ||
target: astro | ||
|
||
- name: Build site | ||
run: docker compose run --rm astro npm run build | ||
|
||
- name: Build and push dependencies | ||
uses: docker/build-push-action@v5 | ||
if: ${{ github.event_name == 'push' }} | ||
with: | ||
push: true | ||
tags: ghcr.io/jordemort/jordemort-blog-dependencies:latest | ||
target: dependencies | ||
|
||
- name: Build and push site | ||
uses: docker/build-push-action@v5 | ||
if: ${{ github.event_name == 'push' }} | ||
with: | ||
push: true | ||
tags: ghcr.io/jordemort/jordemort-blog:latest | ||
target: dependencies |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM node:18-bookworm AS astro | ||
|
||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y \ | ||
build-essential \ | ||
dumb-init \ | ||
gosu \ | ||
libpixman-1-dev \ | ||
libcairo2-dev \ | ||
libpango1.0-dev \ | ||
pkg-config | ||
|
||
COPY astro-entrypoint.sh /usr/local/bin/astro-entrypoint.sh | ||
|
||
ENTRYPOINT [ "/usr/bin/dumb-init", "/usr/local/bin/astro-entrypoint.sh" ] | ||
|
||
######################################################################## | ||
|
||
FROM scratch AS dependencies | ||
|
||
COPY package.json /package.json | ||
COPY package-lock.json /package-lock.json | ||
COPY node_modules/ /node_modules/ | ||
|
||
######################################################################## | ||
|
||
FROM joseluisq/static-web-server:2 AS site | ||
|
||
COPY dist/ /var/www/ | ||
|
||
ENV SERVER_ROOT=/var/www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
my_uid=$(id -u) | ||
want_uid=$(stat -c '%u' .) | ||
|
||
if [ "$my_uid" != "$want_uid" ] ; then | ||
existing_user=$(getent passwd "$want_uid" | cut -d: -f1 || true) | ||
if [ -n "$existing_user" ] ; then | ||
userdel -r "$existing_user" | ||
fi | ||
|
||
want_gid=$(stat -c '%g' .) | ||
existing_group=$(getent group "$want_gid" || true) | ||
if [ -z "$existing_group" ] ; then | ||
groupadd -g "$want_gid" astro | ||
fi | ||
|
||
useradd -m -u "$want_uid" -g "$want_gid" astro | ||
exec gosu astro "$0" "$@" | ||
fi | ||
|
||
npm install | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
services: | ||
kroki: | ||
image: yuzutech/kroki:latest | ||
depends_on: | ||
- blockdiag | ||
- mermaid | ||
- bpmn | ||
- excalidraw | ||
environment: | ||
- KROKI_BLOCKDIAG_HOST=blockdiag | ||
- KROKI_MERMAID_HOST=mermaid | ||
- KROKI_BPMN_HOST=bpmn | ||
- KROKI_EXCALIDRAW_HOST=excalidraw | ||
|
||
blockdiag: | ||
image: yuzutech/kroki-blockdiag:latest | ||
expose: | ||
- "8001" | ||
|
||
mermaid: | ||
image: yuzutech/kroki-mermaid:latest | ||
expose: | ||
- "8002" | ||
|
||
bpmn: | ||
image: yuzutech/kroki-bpmn:latest | ||
expose: | ||
- "8003" | ||
|
||
excalidraw: | ||
image: yuzutech/kroki-excalidraw:latest | ||
expose: | ||
- "8004" | ||
|
||
astro: | ||
image: ghcr.io/jordemort/jordemort-blog-builder:latest | ||
build: | ||
context: . | ||
target: astro | ||
depends_on: | ||
- kroki | ||
volumes: | ||
- .:/usr/src/jordemort.dev | ||
working_dir: /usr/src/jordemort.dev |
Oops, something went wrong.