Skip to content

Commit

Permalink
Set up caching for frontend GitHub action (#4612)
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles authored Oct 18, 2023
1 parent 01a0298 commit 489ae9f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,27 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-node@v1
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Cache Turborepo files
uses: actions/cache@v3
with:
path: frontend/.turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- uses: actions/setup-node@v3
with:
node-version: "18.17.1"
- name: building frontend
- name: Build frontend
run: npm run build:ci
env:
NODE_ENV: ci
USERGEEK_APIKEY: DUMMY_USERGEEK_APIKEY
ROLLBAR_ACCESS_TOKEN: DUMMY_ROLLBAR_ACCESS_TOKEN
OPENCHAT_WEBSITE_VERSION: $GITHUB_SHA
OPENCHAT_WEBSITE_VERSION: 1.0.0
METERED_APIKEY: DUMMY_METERED_APIKEY
1 change: 1 addition & 0 deletions frontend/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prefer-offline = true
18 changes: 9 additions & 9 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "1.0.0",
"description": "",
"scripts": {
"build": "npm i && dotenv -- turbo run build",
"build:ci": "npm ci && dotenv -- turbo run build:ci",
"build:prod": "npm ci && dotenv -- turbo run build:prod",
"build:prod_test": "npm ci && dotenv -- turbo run build:prod_test",
"build:testnet": "npm ci && dotenv -- turbo run build:testnet",
"deploy:prod_test": "npm ci && dotenv -- turbo run deploy:prod_test",
"deploy:prod": "npm ci && dotenv -- turbo run deploy:prod",
"deploy:testnet": "npm ci && dotenv -- turbo run deploy:testnet",
"dev": "npm i && dotenv -- turbo run dev",
"build": "npm i && dotenv -- turbo run build --cache-dir .turbo",
"build:ci": "npm ci && dotenv -- turbo run build:ci --cache-dir .turbo",
"build:prod": "npm ci && dotenv -- turbo run build:prod --cache-dir .turbo",
"build:prod_test": "npm ci && dotenv -- turbo run build:prod_test --cache-dir .turbo",
"build:testnet": "npm ci && dotenv -- turbo run build:testnet --cache-dir .turbo",
"deploy:prod_test": "npm ci && dotenv -- turbo run deploy:prod_test --cache-dir .turbo",
"deploy:prod": "npm ci && dotenv -- turbo run deploy:prod --cache-dir .turbo",
"deploy:testnet": "npm ci && dotenv -- turbo run deploy:testnet --cache-dir .turbo",
"dev": "npm i && dotenv -- turbo run dev --cache-dir .turbo",
"changelog": "auto-changelog --tag-pattern '-website' --file-pattern '^frontend'"
},
"author": "[email protected]",
Expand Down

0 comments on commit 489ae9f

Please sign in to comment.