Skip to content

Commit

Permalink
Adds a build website task to the CI (only if the website code changes) (
Browse files Browse the repository at this point in the history
#72)

* Added building the website as part of the CI (only if website code changes)

* Changing website to test workflow

* Fix bug in the if check - put the website change back (which will test this fix too)

* One more test if website CI works as expected

* Website part of CI working - done testing - put changes to web back.

* Made it more efficient by looking for changes in one job - also minor change to website to test it

* Put change to website back.
  • Loading branch information
darrenge authored Mar 22, 2024
1 parent 9ca34a2 commit 54a21b2
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ on:
workflow_dispatch:
push:
paths-ignore:
- 'website/**'
- '**/*.md'
- '.github'
- '.azure'
branches:
- main
pull_request:
paths-ignore:
- 'website/**'
- '**/*.md'
- '.github'
- '.azure'
branches:
- main
Expand All @@ -24,13 +20,14 @@ env:

jobs:
changes:
name: Check if changes to Tsavorite code
name: Check Tsavorite and Website changed
runs-on: ubuntu-latest # don't need matrix to test where the changes were made in code
permissions:
pull-requests: read
contents: read
outputs:
tsavorite: ${{ steps.filter.outputs.tsavorite }}
website: ${{ steps.filter.outputs.website }}
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -41,7 +38,9 @@ jobs:
filters: |
tsavorite:
- 'libs/storage/Tsavorite/**'
website:
- 'website/**'
# Job to build and test Garnet code
build-test-garnet:
name: Garnet - Build and Test
Expand Down Expand Up @@ -114,3 +113,24 @@ jobs:
name: dotnet-tsavorite-results-${{ matrix.os }}-${{ matrix.framework }}
path: TsavoriteTestResults-${{ matrix.os }}-${{ matrix.framework }}
if: ${{ always() }}

build-website:
name: Build Website
needs: changes
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
if: needs.changes.outputs.website == 'true'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache-dependency-path: ./website/yarn.lock
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build website
run: yarn build

0 comments on commit 54a21b2

Please sign in to comment.