Skip to content

Commit d125efe

Browse files
committed
update GHA docker-build-and-push job settings
Signed-off-by: JF Ding <jfding@gmail.com>
1 parent 1c70525 commit d125efe

8 files changed

Lines changed: 635 additions & 33 deletions

File tree

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
.gitignore
3+
supervisor/target
4+
gh-webhook/.venv
5+
gh-webhook/dist
6+
*.md
7+
docs
8+
tests

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
name: ci
2+
name: docker build and push
33

44
on:
55
push:
6-
tags:
7-
- 'v*'
6+
branches:
7+
- master
88

99
jobs:
1010
main:
@@ -30,8 +30,8 @@ jobs:
3030
uses: docker/build-push-action@v6
3131
with:
3232
push: true
33-
context: ./_docker
34-
file: ./_docker/Dockerfile
33+
context: ./
34+
file: ./deployment/build/Dockerfile
3535
tags: rushiai/auto-reloader:${{ github.ref_name }}
3636

3737
- name: Image digest

deployment/build/Dockerfile

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Build stage for supervisor binary
2-
FROM rust:1.75-slim as rust-builder
2+
FROM rust:1.89-slim AS rust-builder
33

44
WORKDIR /build
5-
COPY VERSION /build/VERSION
6-
COPY supervisor /build/supervisor
7-
RUN cd /build/supervisor && cargo build --release
5+
COPY supervisor/ /build/
6+
RUN
7+
RUN cargo build --release
88

99
# Final stage
1010
FROM python:3.12-slim
@@ -18,26 +18,21 @@ RUN apt-get update && \
1818
curl \
1919
netcat-openbsd \
2020
xz-utils \
21-
nodejs \
22-
npm \
21+
nodejs \
22+
npm \
2323
&& rm -rf /var/lib/apt/lists/*
2424

25-
# for github.com ssh access
26-
COPY dot.ssh/* /root/.ssh/
27-
28-
RUN mkdir -p /scripts
25+
RUN mkdir -p /scripts /webhook
2926
COPY VERSION /scripts/VERSION
30-
COPY check-push.sh /scripts
31-
COPY prod2latest.sh /scripts
32-
COPY cleanup-archives.sh /scripts
27+
COPY src/check-push.sh /scripts
3328

3429
# Copy supervisor binary from build stage
35-
COPY --from=rust-builder /build/supervisor/target/release/supervisor /supervisor
36-
RUN chmod +x /supervisor
30+
COPY --from=rust-builder /build/target/release/git-supervisor /git-supervisor
31+
RUN chmod +x /git-supervisor
3732

38-
WORKDIR /webhook
39-
COPY hook.py /webhook
40-
COPY *.whl /webhook
41-
RUN pip install /webhook/*.whl
33+
# Webhook: install deps and copy script (no wheel build)
34+
RUN pip install --no-cache-dir "flask>=3.0.3"
35+
COPY gh-webhook/hook.py /webhook/hook.py
4236

43-
CMD /webhook/hook.py
37+
WORKDIR /webhook
38+
CMD ["python3", "/webhook/hook.py"]

deployment/build/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ cd $BUILDDIR
2020
docker build -t rushiai/auto-reloader:$TODAY .
2121

2222
# clean up
23-
rm -f *.whl hook.py check-push.sh prod2latest.sh cleanup-archives.sh VERSION
23+
rm -f *.whl hook.py check-push.sh VERSION
2424
rm -rf supervisor/

deployment/build/dot.ssh/id_rsa.pub

Lines changed: 0 additions & 1 deletion
This file was deleted.

deployment/build/dot.ssh/known_hosts

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)