Skip to content

Commit

Permalink
Fix build workflow and use cache in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
DraTeots committed May 8, 2024
1 parent 7d7f18c commit 84c1f12
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # LTS active till Fall 2024
node-version: '20'
cache: 'npm'

- name: Install Dependencies
working-directory: ./firebird-ng
run: npm install

- name: Run Tests
working-directory: ./firebird-ng
run: npm run test-headless
run: npm run test:headless

build:
needs: test
Expand All @@ -32,20 +35,32 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Same Node version as the test job
- name: Install Dependencies
working-directory: ./firebird-ng
run: npm install
node-version: '20'
cache: 'npm'

- name: Build
working-directory: ./firebird-ng
run: ng build --prod
run: npm run build

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: built-site
path: ./firebird-ng/dist/

deploy:
if: github.ref == 'refs/heads/master' || endsWith(github.ref, '-ci')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: built-site
path: ./dist/firebird-ng

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
Expand Down
5 changes: 3 additions & 2 deletions firebird-ng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build": "ng build --configuration=production",
"build:watch": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"test-headless": "ng test --browsers=ChromeHeadless --watch=false --code-coverage --progress=false"
"test:headless": "ng test --browsers=ChromeHeadless --watch=false --code-coverage --progress=false"
},
"private": true,
"dependencies": {
Expand Down

0 comments on commit 84c1f12

Please sign in to comment.