Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a build website task to the CI (only if the website code changes) #72

Merged
merged 11 commits into from
Mar 22, 2024
Merged
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