Skip to content

Commit bf208da

Browse files
committed
Pass Cloudinary URL as a build-time argument
1 parent 47d96b2 commit bf208da

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/deploy.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,16 @@ jobs:
154154
field: "app"
155155

156156
- name: Set up Fly
157-
uses: superfly/flyctl-actions/[email protected]
158-
env:
159-
CLOUDINARY_URL: ${{ secrets.CLOUDINARY_URL }}
157+
uses: superfly/flyctl-actions/setup-flyctl@master
160158

161159
- name: Deploy Staging
162160
if: ${{ github.ref == 'refs/heads/dev' }}
163-
run: flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} --app ${{ steps.app_name.outputs.value }}-staging
161+
run: flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} --build-arg CLOUDINARY_URL=${{ secrets.CLOUDINARY_URL }} --app ${{ steps.app_name.outputs.value }}-staging
164162
env:
165163
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
166164

167165
- name: Deploy Production
168166
if: ${{ github.ref == 'refs/heads/main' }}
169-
run: flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} --app ${{ steps.app_name.outputs.value }}
167+
run: flyctl deploy --remote-only --build-arg COMMIT_SHA=${{ github.sha }} --build-arg CLOUDINARY_URL=${{ secrets.CLOUDINARY_URL }} --app ${{ steps.app_name.outputs.value }}
170168
env:
171169
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ RUN npm prune --omit=dev
2424
# Build the app
2525
FROM base as build
2626

27+
ARG CLOUDINARY_URL
28+
2729
WORKDIR /app
2830

2931
COPY --from=deps /app/node_modules /app/node_modules
3032

3133
COPY . .
32-
RUN npm run build
34+
RUN CLOUDINRAY_URL=${CLOUDINRAY_URL} npm run build
3335

3436
# Finally, build the production image with minimal footprint
3537
FROM base

0 commit comments

Comments
 (0)