Skip to content

Commit

Permalink
Add GHA production build step
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-foster committed Oct 5, 2022
1 parent 106253b commit d7d6c58
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,82 @@ jobs:
- name: Install and Build Deps
run: |
cp .yarnclean.ci .yarnclean
yarn install
yarn build:deps
build-prod:
name: Build
runs-on: ubuntu-latest
container: node:10
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Locate yarn Cache
id: location-yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Fetch yarn Cache
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.location-yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Fetch Deps Cache
uses: actions/cache@v3
id: deps-cache
with:
path: |
packages/codesandbox-api/dist
packages/common/lib
packages/components/lib
packages/deps/dist
packages/executors/dist
packages/node-services/lib
packages/notifications/lib
packages/template-icons/lib
packages/sse-hooks/dist
packages/sandpack-core/lib
packages/browser-eslint-rules/lib
packages/browser-dart-sass/lib
packages/vue3-browser-compiler/lib
packages/vue3-transpiler/lib
standalone-packages/codesandbox-browserfs/dist
standalone-packages/codesandbox-browserfs/build
standalone-packages/vscode-textmate/out
key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-deps-
- name: Fetch Production Cache
uses: actions/cache@v3
id: prod-cache
with:
path: |
www
.git
Dockerfile
key: ${{ runner.os }}-prod-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-prod-
- name: Fetch Homepage Cache
uses: actions/cache@v3
id: homepage-cache
with:
path: packages/homepage/public
key: ${{ runner.os }}-homepage-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-homepage-
- name: Build for Production
run: |
yarn install
yarn build:prod
find packages/homepage/public -name "*.js" -type f -delete
find packages/homepage/public -name "*.json" -type f -delete
find packages/homepage/public -name "*.js.map" -type f -delete

0 comments on commit d7d6c58

Please sign in to comment.