File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 7676 uses : superfly/flyctl-actions/setup-flyctl@1.5
7777
7878 - name : 🚀 Deploy
79- run : flyctl deploy --remote-only
79+ run :
80+ flyctl deploy --remote-only --build-arg
81+ EPICSHOP_GITHUB_REPO=https://github.com/${{ github.repository }}
82+ --build-arg EPICSHOP_COMMIT_SHA=${{ github.sha }}
8083 working-directory : ./epicshop
8184 env :
8285 FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ FROM node:24-bookworm-slim as base
22
33RUN apt-get update && apt-get install -y git
44
5- ENV EPICSHOP_GITHUB_REPO=https://github.com/epicweb-dev/advanced-mcp-features
5+ # Build argument for GitHub repo URL
6+ ARG EPICSHOP_GITHUB_REPO
7+ ENV EPICSHOP_GITHUB_REPO=${EPICSHOP_GITHUB_REPO}
8+
69ENV EPICSHOP_CONTEXT_CWD="/myapp/workshop-content"
710ENV EPICSHOP_HOME_DIR="/myapp/.epicshop"
811ENV EPICSHOP_DEPLOYED="true"
@@ -11,10 +14,19 @@ ENV FLY="true"
1114ENV PORT="8080"
1215ENV NODE_ENV="production"
1316
17+ # Build argument for commit SHA to bust cache when repo changes
18+ ARG EPICSHOP_COMMIT_SHA
19+ ENV EPICSHOP_COMMIT_SHA=${EPICSHOP_COMMIT_SHA}
20+
1421WORKDIR /myapp
1522
1623# Clone the workshop repo during build time, excluding database files
17- RUN git clone --depth 1 ${EPICSHOP_GITHUB_REPO} ${EPICSHOP_CONTEXT_CWD}
24+ # Clone specific commit to keep image small while ensuring cache busting
25+ RUN git init ${EPICSHOP_CONTEXT_CWD} && \
26+ cd ${EPICSHOP_CONTEXT_CWD} && \
27+ git remote add origin ${EPICSHOP_GITHUB_REPO} && \
28+ git fetch --depth 1 origin ${EPICSHOP_COMMIT_SHA} && \
29+ git checkout ${EPICSHOP_COMMIT_SHA}
1830
1931ADD . .
2032
You can’t perform that action at this time.
0 commit comments