Skip to content

Commit ee456bb

Browse files
committed
chore: related to #20
1 parent 930001a commit ee456bb

15 files changed

+135
-193
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Check for Docker image updates
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 * * * *"
7+
8+
jobs:
9+
check-updates:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
updates: ${{ steps.check-updates.outputs.updates }}
13+
14+
steps:
15+
- name: Download previous state
16+
uses: actions/download-artifact@v3
17+
continue-on-error: true
18+
with:
19+
name: last-checked-versions
20+
path: .github/
21+
22+
- name: Check for updates
23+
id: check-updates
24+
run: |
25+
declare -A repos=(
26+
["litefs"]="https://github.com/superfly/litefs.git refs/tags/"
27+
["wireproxy"]="https://github.com/whyvl/wireproxy.git"
28+
["nginx-ssl-ja3"]="https://github.com/fooinha/nginx-ssl-ja3.git"
29+
["ingress-nginx"]="https://github.com/kubernetes/ingress-nginx.git refs/tags/controller"
30+
["samba"]="https://github.com/samba-team/samba.git refs/tags/"
31+
["stolon"]="https://github.com/sorintlab/stolon.git refs/tags/"
32+
["nitter"]="https://github.com/zedeus/nitter.git"
33+
["tor"]="https://github.com/m0wer/docker-tor.git"
34+
["stash"]="https://github.com/stashed/stash.git refs/tags/"
35+
["logrotate"]="https://github.com/blacklabelops/logrotate.git"
36+
["cert-manager-webhook-powerdns"]="https://github.com/lordofsystem/cert-manager-webhook-powerdns.git"
37+
["nginx-ssl-fingerprint"]="https://github.com/phuslu/nginx-ssl-fingerprint.git"
38+
)
39+
40+
updates=""
41+
mkdir -p .github/versions
42+
43+
for repo in "${!repos[@]}"; do
44+
if [[ "${repos[$repo]}" == *"refs/tags/"* ]]; then
45+
latest=$(git ls-remote --refs --tags ${repos[$repo]%% *} | sort -t '/' -k 3 -V | tail -n1)
46+
else
47+
latest=$(git ls-remote ${repos[$repo]} | head -n1)
48+
fi
49+
50+
if [ -f ".github/versions/${repo}" ]; then
51+
previous=$(cat ".github/versions/${repo}")
52+
if [ "$latest" != "$previous" ]; then
53+
updates="${updates}${repo},"
54+
fi
55+
else
56+
updates="${updates}${repo},"
57+
fi
58+
echo "$latest" > ".github/versions/${repo}"
59+
done
60+
61+
if [ ! -z "$updates" ]; then
62+
updates=${updates%,}
63+
echo "updates=${updates}" >> $GITHUB_OUTPUT
64+
fi
65+
66+
- name: Upload new state
67+
uses: actions/upload-artifact@v3
68+
with:
69+
name: last-checked-versions
70+
path: .github/versions/
71+
retention-days: 1
72+
73+
trigger-workflows:
74+
needs: check-updates
75+
if: needs.check-updates.outputs.updates != ''
76+
runs-on: ubuntu-latest
77+
78+
steps:
79+
- name: Trigger relevant workflows
80+
run: |
81+
IFS=',' read -ra UPDATES <<< "${{ needs.check-updates.outputs.updates }}"
82+
for repo in "${UPDATES[@]}"; do
83+
case $repo in
84+
"litefs")
85+
gh workflow run docker-build-litefs-patched.yaml
86+
;;
87+
"wireproxy")
88+
gh workflow run docker-build-wireproxy-debian.yml
89+
;;
90+
"nginx-ssl-ja3")
91+
gh workflow run docker-build-openresty-ssl-ja3.yml
92+
;;
93+
"ingress-nginx")
94+
gh workflow run docker-build-ingress-nginx.yml
95+
gh workflow run docker-build-ingress-nginx-controller-dynamic-modules.yml
96+
gh workflow run docker-build-ingress-nginx-custom.yml
97+
;;
98+
"samba")
99+
gh workflow run docker-build-samba.yml
100+
;;
101+
"stolon")
102+
gh workflow run docker-build-stolon.yml
103+
;;
104+
"nitter")
105+
gh workflow run docker-build-nitter-patched.yml
106+
;;
107+
"tor")
108+
gh workflow run docker-build-tor-single-hop.yml
109+
;;
110+
"stash")
111+
gh workflow run docker-build-stash.yml
112+
;;
113+
"logrotate")
114+
gh workflow run docker-build-logrotate.yml
115+
;;
116+
"cert-manager-webhook-powerdns")
117+
gh workflow run docker-build-cert-manager-webhook-powerdns.yml
118+
;;
119+
"nginx-ssl-fingerprint")
120+
gh workflow run docker-build-nginx-ssl-fingerprint.yml
121+
;;
122+
esac
123+
done
124+
env:
125+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docker-build-cert-manager-webhook-powerdns.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Docker build cert-manager-webhook-powerdns image
22

33
on:
44
workflow_dispatch:
5-
schedule:
6-
- cron: "0 * * * *"
75
push:
86
paths:
97
- '.github/workflows/docker-build-cert-manager-webhook-powerdns.yml'
@@ -22,15 +20,8 @@ jobs:
2220
echo "commit=$(git ls-remote https://github.com/lordofsystem/cert-manager-webhook-powerdns.git | head -n1 | awk '{print $1;}')" >> $GITHUB_ENV
2321
shell: bash
2422

25-
- uses: actions/cache@v4
26-
id: cache
27-
with:
28-
path: cert-manager-webhook-powerdns
29-
key: ${{ runner.os }}-v1-${{ env.commit }}
30-
3123
- name: Set up QEMU
3224
uses: docker/setup-qemu-action@v2
33-
if: steps.cache.outputs.cache-hit != 'true'
3425
with:
3526
platforms: all
3627

@@ -39,33 +30,28 @@ jobs:
3930

4031
- name: Check Out Repo lordofsystem/cert-manager-webhook-powerdns
4132
uses: actions/checkout@v3
42-
if: steps.cache.outputs.cache-hit != 'true'
4333
with:
4434
repository: "lordofsystem/cert-manager-webhook-powerdns"
4535
ref: 'main'
4636
path: 'cert-manager-webhook-powerdns-git'
4737

4838
- name: Login to Quay.io
49-
if: steps.cache.outputs.cache-hit != 'true'
5039
uses: docker/login-action@v2
5140
with:
5241
registry: quay.io
5342
username: ${{ secrets.QUAY_USERNAME }}
5443
password: ${{ secrets.QUAY_PASSWORD }}
5544

5645
- name: Set up Docker Buildx
57-
if: steps.cache.outputs.cache-hit != 'true'
5846
id: buildx
5947
uses: docker/setup-buildx-action@v2
6048
with:
6149
version: latest
6250

6351
- name: Set up build timestamp
64-
if: steps.cache.outputs.cache-hit != 'true'
6552
run: echo "timestamp=$(date +%Y%m%d)" >> $GITHUB_ENV
6653

6754
- name: Build and push docker image
68-
if: steps.cache.outputs.cache-hit != 'true'
6955
id: docker_build_new
7056
uses: docker/build-push-action@v3
7157
with:

.github/workflows/docker-build-ingress-nginx-controller-dynamic-modules.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Docker build ingress-nginx-controller-dynamic-modules image
22

33
on:
44
workflow_dispatch:
5-
schedule:
6-
- cron: "0 * * * *"
75
push:
86
paths:
97
- '.github/workflows/docker-build-ingress-nginx-controller-dynamic-modules.yml'
@@ -22,42 +20,31 @@ jobs:
2220
echo "tag=$(git ls-remote --refs --tags https://github.com/kubernetes/ingress-nginx |grep refs/tags/controller | tail -1 | awk '{print $2;}' | sed 's/refs\/tags\/controller-//')" >> $GITHUB_ENV
2321
shell: bash
2422

25-
- uses: actions/cache@v4
26-
id: cache
27-
with:
28-
path: ingress-nginx-controller-dynamic-modules
29-
key: ${{ runner.os }}-v4-${{ env.tag }}
30-
3123
- name: Set up QEMU
3224
uses: docker/setup-qemu-action@v2
33-
if: steps.cache.outputs.cache-hit != 'true'
3425
with:
3526
platforms: all
3627

3728
- name: Check Out Repo
3829
uses: actions/checkout@v3
3930

4031
- name: Login to Quay.io
41-
if: steps.cache.outputs.cache-hit != 'true'
4232
uses: docker/login-action@v2
4333
with:
4434
registry: quay.io
4535
username: ${{ secrets.QUAY_USERNAME }}
4636
password: ${{ secrets.QUAY_PASSWORD }}
4737

4838
- name: Set up Docker Buildx
49-
if: steps.cache.outputs.cache-hit != 'true'
5039
id: buildx
5140
uses: docker/setup-buildx-action@v2
5241
with:
5342
version: latest
5443

5544
- name: Set up build timestamp
56-
if: steps.cache.outputs.cache-hit != 'true'
5745
run: echo "timestamp=$(date +%Y%m%d)" >> $GITHUB_ENV
5846

5947
- name: Build and push docker image
60-
if: steps.cache.outputs.cache-hit != 'true'
6148
id: docker_build_new
6249
uses: docker/build-push-action@v3
6350
with:

.github/workflows/docker-build-ingress-nginx-custom.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Docker build ingress-nginx-custom image
22

33
on:
44
workflow_dispatch:
5-
schedule:
6-
- cron: "0 * * * *"
75
push:
86
paths:
97
- '.github/workflows/docker-build-ingress-nginx-custom.yml'
@@ -22,42 +20,31 @@ jobs:
2220
echo "tag=$(git ls-remote --refs --tags https://github.com/kubernetes/ingress-nginx |grep refs/tags/controller | tail -1 | awk '{print $2;}' | sed 's/refs\/tags\/controller-//')" >> $GITHUB_ENV
2321
shell: bash
2422

25-
- uses: actions/cache@v4
26-
id: cache
27-
with:
28-
path: ingress-nginx-custom
29-
key: ${{ runner.os }}-v1-${{ env.tag }}
30-
3123
- name: Set up QEMU
3224
uses: docker/setup-qemu-action@v2
33-
if: steps.cache.outputs.cache-hit != 'true'
3425
with:
3526
platforms: all
3627

3728
- name: Check Out Repo
3829
uses: actions/checkout@v3
3930

4031
- name: Login to Quay.io
41-
if: steps.cache.outputs.cache-hit != 'true'
4232
uses: docker/login-action@v2
4333
with:
4434
registry: quay.io
4535
username: ${{ secrets.QUAY_USERNAME }}
4636
password: ${{ secrets.QUAY_PASSWORD }}
4737

4838
- name: Set up Docker Buildx
49-
if: steps.cache.outputs.cache-hit != 'true'
5039
id: buildx
5140
uses: docker/setup-buildx-action@v2
5241
with:
5342
version: latest
5443

5544
- name: Set up build timestamp
56-
if: steps.cache.outputs.cache-hit != 'true'
5745
run: echo "timestamp=$(date +%Y%m%d)" >> $GITHUB_ENV
5846

5947
- name: Build and push docker image
60-
if: steps.cache.outputs.cache-hit != 'true'
6148
id: docker_build_new
6249
uses: docker/build-push-action@v3
6350
with:

.github/workflows/docker-build-ingress-nginx.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Docker build ingress-nginx image
22

33
on:
44
workflow_dispatch:
5-
#schedule:
6-
# - cron: "0 * * * *"
75
push:
86
paths:
97
- '.github/workflows/docker-build-ingress-nginx.yml'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Docker build litefs patched docker image
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- '.github/workflows/docker-build-litefs-patched.yml'
8+
- 'litefs-patched/**'
9+
10+
// ... existing code ...

.github/workflows/docker-build-logrotate.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Docker build logrotate image
22

33
on:
44
workflow_dispatch:
5-
schedule:
6-
- cron: "0 * * * *"
75
push:
86
paths:
97
- '.github/workflows/docker-build-logrotate.yml'
@@ -22,15 +20,8 @@ jobs:
2220
echo "commit=$(git ls-remote https://github.com/blacklabelops/logrotate.git | head -n1 | awk '{print $1;}')" >> $GITHUB_ENV
2321
shell: bash
2422

25-
- uses: actions/cache@v4
26-
id: cache
27-
with:
28-
path: logrotate
29-
key: ${{ runner.os }}-v2-${{ env.commit }}
30-
3123
- name: Set up QEMU
3224
uses: docker/setup-qemu-action@v2
33-
if: steps.cache.outputs.cache-hit != 'true'
3425
with:
3526
platforms: all
3627

@@ -39,33 +30,28 @@ jobs:
3930

4031
- name: Check Out Repo blacklabelops/logrotate
4132
uses: actions/checkout@v3
42-
if: steps.cache.outputs.cache-hit != 'true'
4333
with:
4434
repository: "blacklabelops/logrotate"
4535
ref: 'master'
4636
path: 'logrotate-git'
4737

4838
- name: Login to Quay.io
49-
if: steps.cache.outputs.cache-hit != 'true'
5039
uses: docker/login-action@v2
5140
with:
5241
registry: quay.io
5342
username: ${{ secrets.QUAY_USERNAME }}
5443
password: ${{ secrets.QUAY_PASSWORD }}
5544

5645
- name: Set up Docker Buildx
57-
if: steps.cache.outputs.cache-hit != 'true'
5846
id: buildx
5947
uses: docker/setup-buildx-action@v2
6048
with:
6149
version: latest
6250

6351
- name: Set up build timestamp
64-
if: steps.cache.outputs.cache-hit != 'true'
6552
run: echo "timestamp=$(date +%Y%m%d)" >> $GITHUB_ENV
6653

6754
- name: Build and push docker image
68-
if: steps.cache.outputs.cache-hit != 'true'
6955
id: docker_build_new
7056
uses: docker/build-push-action@v3
7157
with:

0 commit comments

Comments
 (0)