Compare commits

6 Commits

Author SHA1 Message Date
47aade71cf fix: resolve heredoc parsing error in deploy-oci Makefile target
Extract inline Dockerfile to Dockerfile.oci and scp it instead of
generating it via heredoc over SSH. Make's line-continuation backslash
was causing the heredoc delimiter to be parsed as 'DEOFnFROM' by the
remote shell, breaking the image build step.
2026-04-07 10:54:22 +01:00
f45e842370 fix: use aarch64-linux-musl-gcc linker for cross-compile to musl target
Some checks failed
Deploy to OCI / deploy (push) Failing after 40s
2026-04-07 10:46:34 +01:00
Fam Zheng
720c32c485 ci: use login shell (bash -l) to fix npm PATH on host runner
Some checks failed
Deploy to OCI / deploy (push) Failing after 30s
2026-04-07 10:43:17 +01:00
bd3842f854 ci: use absolute /usr/bin/npm path for host runner
Some checks failed
Deploy to OCI / deploy (push) Failing after 0s
2026-04-07 10:42:29 +01:00
8111812d3b ci: fix PATH for host runner - include /usr/bin and cargo bin
Some checks failed
Deploy to OCI / deploy (push) Failing after 0s
2026-04-07 10:41:27 +01:00
73e05ef0ad ci: fix checkout - replace actions/checkout@v4 with raw git (no node in host runner)
Some checks failed
Deploy to OCI / deploy (push) Failing after 0s
2026-04-07 10:40:36 +01:00
4 changed files with 21 additions and 13 deletions

View File

@@ -8,9 +8,17 @@ on:
jobs: jobs:
deploy: deploy:
runs-on: self-hosted runs-on: self-hosted
defaults:
run:
shell: bash -l {0}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 run: |
if [ -d .git ]; then
git fetch origin master && git reset --hard origin/master && git clean -fd
else
git clone ${{ gitea.server_url }}/${{ gitea.repository }} . && git checkout ${{ gitea.sha }}
fi
- name: Install frontend dependencies - name: Install frontend dependencies
run: cd web && npm ci run: cd web && npm ci

9
Dockerfile.oci Normal file
View File

@@ -0,0 +1,9 @@
FROM alpine:3.21
RUN apk add --no-cache git ca-certificates
WORKDIR /app
COPY repo-vis-server ./
COPY dist ./web/dist/
ENV PORT=8080
ENV FRONTEND_DIR=./web/dist
EXPOSE 8080
CMD ["./repo-vis-server"]

View File

@@ -39,18 +39,9 @@ deploy-oci: build-arm
ssh $(OCI_HOST) "rm -rf $(OCI_TMP) && mkdir -p $(OCI_TMP)" ssh $(OCI_HOST) "rm -rf $(OCI_TMP) && mkdir -p $(OCI_TMP)"
scp server/target/$(MUSL_TARGET_ARM)/release/repo-vis-server $(OCI_HOST):$(OCI_TMP)/ scp server/target/$(MUSL_TARGET_ARM)/release/repo-vis-server $(OCI_HOST):$(OCI_TMP)/
cd web && tar czf /tmp/_rv_dist.tar.gz dist && scp /tmp/_rv_dist.tar.gz $(OCI_HOST):$(OCI_TMP)/ cd web && tar czf /tmp/_rv_dist.tar.gz dist && scp /tmp/_rv_dist.tar.gz $(OCI_HOST):$(OCI_TMP)/
scp Dockerfile.oci $(OCI_HOST):$(OCI_TMP)/Dockerfile
@echo "==> Building image on OCI..." @echo "==> Building image on OCI..."
ssh $(OCI_HOST) 'cd $(OCI_TMP) && tar xzf _rv_dist.tar.gz && cat > Dockerfile <<DEOF\n\ ssh $(OCI_HOST) 'cd $(OCI_TMP) && tar xzf _rv_dist.tar.gz && \
FROM alpine:3.21\n\
RUN apk add --no-cache git ca-certificates\n\
WORKDIR /app\n\
COPY repo-vis-server ./\n\
COPY dist ./web/dist/\n\
ENV PORT=8080\n\
ENV FRONTEND_DIR=./web/dist\n\
EXPOSE 8080\n\
CMD ["./repo-vis-server"]\n\
DEOF\n\
sudo docker build -t repo-vis:latest . && \ sudo docker build -t repo-vis:latest . && \
sudo docker save repo-vis:latest -o /tmp/_rv.tar && \ sudo docker save repo-vis:latest -o /tmp/_rv.tar && \
sudo k3s ctr images import /tmp/_rv.tar' sudo k3s ctr images import /tmp/_rv.tar'

View File

@@ -1,2 +1,2 @@
[target.aarch64-unknown-linux-musl] [target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-gnu-gcc" linker = "aarch64-linux-musl-gcc"