Skip to content

Commit

Permalink
chore(project): improved caching for export
Browse files Browse the repository at this point in the history
  • Loading branch information
darkoatanasovski committed Aug 9, 2023
1 parent 8a17247 commit 8503b6d
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
type: input
description: 'unique tag'

permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -24,12 +22,37 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 18.x

- name: Check Build Cache
id: check-cache
run: echo ::set-output name=cache-exists::$(test -d build && echo true || echo false)

- name: Build WebApp
if: ${{ steps.check-cache.outputs.cache-exists != 'true' }}
run: |
yarn
npx vite build --mode prod
- name: Restore Build Cache
if: steps.check-cache.outputs.cache-exists == 'true'
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-build
restore-keys: ${{ runner.os }}-build

- name: Cache Build Artifacts
if: ${{ steps.check-cache.outputs.cache-exists != 'true' }}
uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-build

- name: Inject config-id in webapp.ini
run: |
touch build/public/.webapp.ini
echo "defaultConfigSource=${{ github.event.inputs.tag }}" > build/public/.webapp.ini
- name: Uploading artifact
if: always()
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 8503b6d

Please sign in to comment.