Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8d0f1b8

Browse files
committed
Load git repositories via a webhook
1 parent d6cd398 commit 8d0f1b8

File tree

4 files changed

+60
-1
lines changed

4 files changed

+60
-1
lines changed

.github/workflows/build-image.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ env:
99
REGISTRY: ghcr.io
1010
IMAGE_NAME: ${{ github.repository }}
1111
CADDY_VERSION: "2.4.6"
12+
CADDY_GIT_VERSION: "1.0.4"
1213

1314
jobs:
1415
build-and-push-image:
@@ -41,6 +42,7 @@ jobs:
4142
file: ./Containerfile
4243
build-args: |
4344
CADDY_VERSION=${{ env.CADDY_VERSION }}
45+
CADDY_GIT_VERSION=${{ env.CADDY_GIT_VERSION }}
4446
push: true
4547
tags: ${{ steps.meta.outputs.tags }}
4648
labels: ${{ steps.meta.outputs.labels }}

Caddyfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
1+
{
2+
git {
3+
repo basemap {
4+
base_dir {$SITE_DIR:sites}
5+
url https://github.com/matplotlib/basemap.git
6+
branch gh-pages
7+
}
8+
repo cheatsheets {
9+
base_dir {$SITE_DIR:sites}
10+
url https://github.com/matplotlib/cheatsheets.git
11+
branch gh-pages
12+
}
13+
repo governance {
14+
base_dir {$SITE_DIR:sites}
15+
url https://github.com/matplotlib/governance.git
16+
branch gh-pages
17+
}
18+
repo matplotblog {
19+
base_dir {$SITE_DIR:sites}
20+
url https://github.com/matplotlib/matplotblog.git
21+
branch gh-pages
22+
}
23+
repo matplotlib.github.com {
24+
base_dir {$SITE_DIR:sites}
25+
url https://github.com/matplotlib/matplotlib.github.com.git
26+
branch main
27+
}
28+
repo mpl-altair {
29+
base_dir {$SITE_DIR:sites}
30+
url https://github.com/matplotlib/mpl-altair.git
31+
branch gh-pages
32+
}
33+
repo mpl-bench {
34+
base_dir {$SITE_DIR:sites}
35+
url https://github.com/matplotlib/mpl-bench.git
36+
branch gh-pages
37+
}
38+
repo mpl-brochure-site {
39+
base_dir {$SITE_DIR:sites}
40+
url https://github.com/matplotlib/mpl-brochure-site.git
41+
branch gh-pages
42+
}
43+
repo mpl-third-party {
44+
base_dir {$SITE_DIR:sites}
45+
url https://github.com/matplotlib/mpl-third-party.git
46+
branch gh-pages
47+
}
48+
}
49+
}
50+
151
# Snippet to allow working with git checkouts of project sites that become
252
# toplevel directories.
353
(subproject) {
@@ -10,6 +60,9 @@
1060
try_files {path}.html {path}
1161
file_server
1262
}
63+
route /webhook/{args.0} {
64+
git update repo {args.0}
65+
}
1366
}
1467

1568
# Set this variable in the environment when running in production.

Containerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
ARG CADDY_VERSION=latest
2+
ARG CADDY_GIT_VERSION=latest
23
FROM docker.io/library/caddy:${CADDY_VERSION}-builder AS builder
34

4-
RUN xcaddy build
5+
RUN xcaddy build \
6+
--with github.com/greenpau/caddy-git@${CADDY_GIT_VERSION}
57

68
FROM docker.io/library/caddy:${CADDY_VERSION}
79

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
RUNTIME ?= podman
22
CADDY_IMAGE ?= caddy-mpl
33
CADDY_VERSION ?= 2.4.6
4+
CADDY_GIT_VERSION ?= 1.0.4
45

56
serve:
67
mkdir -p sites
@@ -15,6 +16,7 @@ serve:
1516
image:
1617
$(RUNTIME) build \
1718
--build-arg=CADDY_VERSION=$(CADDY_VERSION) \
19+
--build-arg=CADDY_GIT_VERSION=v$(CADDY_GIT_VERSION) \
1820
-t $(CADDY_IMAGE):$(CADDY_VERSION) \
1921
-f Containerfile
2022

0 commit comments

Comments
 (0)