Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
use env secrets in codegen step
Browse files Browse the repository at this point in the history
  • Loading branch information
alecananian committed Jan 18, 2024
1 parent 35c6b9e commit 362736a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
- develop
pull_request: {}
# pull_request: {}
jobs:
# typecheck:
# name: Check Types
Expand All @@ -31,7 +31,7 @@ jobs:
name: Deploy
runs-on: ubuntu-latest
# needs: typecheck
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') && github.event_name == 'push' }}
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
Expand Down Expand Up @@ -59,6 +59,7 @@ jobs:
name: Post-Deployment Tasks
runs-on: ubuntu-latest
needs: deploy
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Purge Cloudflare Cache
uses: jakejarvis/cloudflare-purge-action@master
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ RUN npm install --include=dev
# Copy application code
COPY --link . .

# Create environment file
RUN --mount=type=secret,id=dotenv,dst=env \
tr ' ' '\n' < env > .env

# Generate code
RUN npm run codegen

# Build application
RUN --mount=type=secret,id=dotenv,dst=env \
tr ' ' '\n' < env > .env && \
npm run build
RUN npm run build

# Remove development dependencies
RUN npm prune --omit=dev


# Final stage for app image
FROM base

Expand Down

0 comments on commit 362736a

Please sign in to comment.