File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 7676 uses :
superfly/flyctl-actions/[email protected] 7777
7878 - name : 🚀 Deploy
79- run : flyctl deploy --remote-only
79+ run :
80+ flyctl deploy --remote-only --build-arg EPICSHOP_COMMIT_SHA=${{
81+ github.sha }}
8082 working-directory : ./epicshop
8183 env :
8284 FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
Original file line number Diff line number Diff line change @@ -11,10 +11,19 @@ ENV FLY="true"
1111ENV PORT="8080"
1212ENV NODE_ENV="production"
1313
14+ # Build argument for commit SHA to bust cache when repo changes
15+ ARG EPICSHOP_COMMIT_SHA
16+ ENV EPICSHOP_COMMIT_SHA=${EPICSHOP_COMMIT_SHA}
17+
1418WORKDIR /myapp
1519
1620# Clone the workshop repo during build time, excluding database files
17- RUN git clone --depth 1 ${EPICSHOP_GITHUB_REPO} ${EPICSHOP_CONTEXT_CWD}
21+ # Clone specific commit to keep image small while ensuring cache busting
22+ RUN git init ${EPICSHOP_CONTEXT_CWD} && \
23+ cd ${EPICSHOP_CONTEXT_CWD} && \
24+ git remote add origin ${EPICSHOP_GITHUB_REPO} && \
25+ git fetch --depth 1 origin ${EPICSHOP_COMMIT_SHA} && \
26+ git checkout ${EPICSHOP_COMMIT_SHA}
1827
1928ADD . .
2029
You can’t perform that action at this time.
0 commit comments