Skip to content

Commit

Permalink
fix: add nodejs cache
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Dec 23, 2024
1 parent dcda683 commit f5e342a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: NodeJS Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-npm-cache-
- name: Install Deps
run: npm install

- name: Build
run: npm run build --preset=cloudflare_pages

- uses: actions/upload-artifact@v4
with:
name: ${{env.PROJECT_NAME}}-dist
path: ./dist/

- name: Deploy
uses: cloudflare/wrangler-action@v3
# env:
Expand All @@ -46,7 +50,7 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy ./.output --project-name "${{ env.PROJECT_NAME }}"
command: pages deploy ./dist --project-name "${{ env.PROJECT_NAME }}"
# secrets: |
# YOUR_SECRET
# YOUR_OTHER_SECRET
2 changes: 2 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name = "rustlings"
main = "./.output/server/index.mjs"
compatibility_date = "2024-03-14"
compatibility_flags = ["nodejs_compat"]
pages_build_output_dir = "./dist"

rules = [
{ type = "ESModule", globs = ["**/*.js", "**/*.mjs"]},
Expand Down

0 comments on commit f5e342a

Please sign in to comment.