ci: clone cal-shared locally for Docker build
CI/CD / deploy (push) Successful in 1m21s Details

Gitea archive endpoint returns 500. Clone cal-shared repo
and use as local file dependency in Docker build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-01 13:04:17 -07:00
parent d46eda6d17
commit 81794f09b4
2 changed files with 6 additions and 4 deletions

View File

@ -31,7 +31,8 @@ jobs:
- name: Build and push image
run: |
docker build --network=host -t ${{ env.IMAGE }}:${{ env.IMAGE_TAG }} -t ${{ env.IMAGE }}:latest .
git clone --depth 1 http://jeffemmett:${{ secrets.REPO_READ_TOKEN }}@server:3000/jeffemmett/cal-shared.git cal-shared
docker build -t ${{ env.IMAGE }}:${{ env.IMAGE_TAG }} -t ${{ env.IMAGE }}:latest .
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ secrets.REGISTRY_USER }} --password-stdin
docker push ${{ env.IMAGE }}:${{ env.IMAGE_TAG }}
docker push ${{ env.IMAGE }}:latest

View File

@ -3,11 +3,12 @@ FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
# Copy package files and local dependency
COPY package.json package-lock.json* ./
COPY cal-shared/ ./cal-shared/
# Replace Gitea public URL with internal for CI builds
RUN sed -i 's|https://gitea.jeffemmett.com|http://localhost:3000|g' package.json
# Replace Gitea archive URL with local copy for CI builds
RUN sed -i 's|https://gitea.jeffemmett.com/jeffemmett/cal-shared/archive/main.tar.gz|file:./cal-shared|g' package.json
# Install dependencies
RUN npm install