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

Skip to content

Commit 64e6969

Browse files
committed
Load git repositories via a webhook
1 parent d6cd398 commit 64e6969

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-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+
WEBHOOK_VERSION: "1.0.8"
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+
WEBHOOK_VERSION=${{ env.WEBHOOK_VERSION }}
4446
push: true
4547
tags: ${{ steps.meta.outputs.tags }}
4648
labels: ${{ steps.meta.outputs.labels }}

Caddyfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,49 @@
3333
rewrite / /mpl-brochure-site/index.html
3434
rewrite @brochure /mpl-brochure-site{http.matchers.file.relative}
3535

36+
route /webhook {
37+
webhook {
38+
repo https://github.com/matplotlib/basemap.git
39+
path {$SITE_DIR:sites}/basemap
40+
branch gh-pages
41+
}
42+
webhook {
43+
repo https://github.com/matplotlib/cheatsheets.git
44+
path {$SITE_DIR:sites}/cheatsheets
45+
branch gh-pages
46+
}
47+
webhook {
48+
repo https://github.com/matplotlib/governance.git
49+
path {$SITE_DIR:sites}/governance
50+
branch gh-pages
51+
}
52+
webhook {
53+
repo https://github.com/matplotlib/matplotblog.git
54+
path {$SITE_DIR:sites}/matplotblog
55+
branch gh-pages
56+
}
57+
webhook {
58+
repo https://github.com/matplotlib/mpl-altair.git
59+
path {$SITE_DIR:sites}/mpl-altair
60+
branch gh-pages
61+
}
62+
webhook {
63+
repo https://github.com/matplotlib/mpl-bench.git
64+
path {$SITE_DIR:sites}/mpl-bench
65+
branch gh-pages
66+
}
67+
webhook {
68+
repo https://github.com/matplotlib/mpl-third-party.git
69+
path {$SITE_DIR:sites}/mpl-third-party
70+
branch gh-pages
71+
}
72+
webhook {
73+
repo https://github.com/matplotlib/mpl-brochure-site.git
74+
path {$SITE_DIR:sites}/mpl-brochure-site
75+
branch gh-pages
76+
}
77+
}
78+
3679
# Finally try any of the versioned docs.
3780
handle {
3881
root * {$SITE_DIR:sites}/matplotlib.github.com

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 WEBHOOK_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/WingLim/caddy-webhook@${WEBHOOK_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+
WEBHOOK_VERSION ?= 1.0.8
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=WEBHOOK_VERSION=v$(WEBHOOK_VERSION) \
1820
-t $(CADDY_IMAGE):$(CADDY_VERSION) \
1921
-f Containerfile
2022

0 commit comments

Comments
 (0)