Skip to content

Commit 44b7086

Browse files
update deploy setup for renamed repo
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ea39c57 commit 44b7086

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

.github/workflows/validate.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ on:
88
push:
99
branches:
1010
- 'main'
11-
pull_request:
12-
branches:
13-
- 'main'
11+
pull_request: {}
12+
1413
jobs:
1514
setup:
15+
name: 🔧 Setup
16+
timeout-minutes: 10
1617
strategy:
1718
matrix:
1819
os: [ubuntu-latest, windows-latest, macos-latest]
@@ -25,7 +26,7 @@ jobs:
2526
- name: ⎔ Setup node
2627
uses: actions/setup-node@v4
2728
with:
28-
node-version: 23
29+
node-version: 24
2930

3031
- name: ▶️ Add repo
3132
run: |
@@ -44,6 +45,7 @@ jobs:
4445

4546
deploy:
4647
name: 🚀 Deploy
48+
timeout-minutes: 10
4749
runs-on: ubuntu-latest
4850
# only deploy main branch on pushes on non-forks
4951
if:
@@ -58,7 +60,10 @@ jobs:
5860
uses: superfly/flyctl-actions/setup-flyctl@1.5
5961

6062
- name: 🚀 Deploy
61-
run: flyctl deploy --remote-only
63+
run: >
64+
flyctl deploy --remote-only
65+
--build-arg EPICSHOP_GITHUB_REPO=https://github.com/${{ github.repository }}
66+
--build-arg EPICSHOP_COMMIT_SHA=${{ github.sha }}
6267
working-directory: ./epicshop
6368
env:
6469
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

epicshop/Dockerfile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ FROM node:24-bookworm-slim as base
22

33
RUN apt-get update && apt-get install -y git
44

5-
ENV EPICSHOP_GITHUB_REPO=https://github.com/epicweb-dev/e2e-react-application-testing-with-playwright
5+
# Build argument for GitHub repo URL
6+
ARG EPICSHOP_GITHUB_REPO
7+
ENV EPICSHOP_GITHUB_REPO=${EPICSHOP_GITHUB_REPO}
8+
69
ENV EPICSHOP_CONTEXT_CWD="/myapp/workshop-content"
710
ENV EPICSHOP_HOME_DIR="/myapp/.epicshop"
811
ENV EPICSHOP_DEPLOYED="true"
@@ -11,10 +14,19 @@ ENV FLY="true"
1114
ENV PORT="8080"
1215
ENV 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+
1421
WORKDIR /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

1931
ADD . .
2032

0 commit comments

Comments
 (0)