From dfeb168fe167e1875f14944db64aa61ce487f7f9 Mon Sep 17 00:00:00 2001 From: Sagar Lakshmipathy <18vidhyasagar@gmail.com> Date: Thu, 2 Nov 2023 13:42:41 -0700 Subject: [PATCH 1/4] Create test-deploy.yml Adding gh action workflow that will be triggered for every PR if the changes happen in website directory. Note: The code changes outside of website directory on main branch won't go through this check. The changes will be tested with `yarn build` command to make sure the changes don't break the existing docs. --- .github/workflows/test-deploy.yml | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/test-deploy.yml diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 000000000..4056fc5b4 --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,38 @@ +name: Test deployment + +on: + pull_request: + branches: + - main + paths: + - '.github/workflows/test-deploy.yml' + - 'website/**' + +jobs: + test-deploy: + name: Test deployment + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./website + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Get yarn cache + id: yarn-cache + run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }} + key: ${{ runner.os }}-website-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-website- + + - run: yarn install --frozen-lockfile + - run: yarn build From b7eeffe5dbaf3fe1ef50b950fd66a21a6c700943 Mon Sep 17 00:00:00 2001 From: Sagar Lakshmipathy <18vidhyasagar@gmail.com> Date: Tue, 7 Nov 2023 08:07:30 -0800 Subject: [PATCH 2/4] Update and rename test-deploy.yml to site-test.yml --- .github/workflows/{test-deploy.yml => site-test.yml} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{test-deploy.yml => site-test.yml} (94%) diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/site-test.yml similarity index 94% rename from .github/workflows/test-deploy.yml rename to .github/workflows/site-test.yml index 4056fc5b4..83754ab0d 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/site-test.yml @@ -1,4 +1,4 @@ -name: Test deployment +name: Site Test on: pull_request: @@ -10,7 +10,7 @@ on: jobs: test-deploy: - name: Test deployment + name: Site Test runs-on: ubuntu-latest defaults: run: From dc6a6f329824e8e9224aa8d75d6f60ef0450a23c Mon Sep 17 00:00:00 2001 From: Sagar Lakshmipathy <18vidhyasagar@gmail.com> Date: Tue, 7 Nov 2023 18:32:28 -0800 Subject: [PATCH 3/4] Rename file, update refs and use cache from setup-node --- .github/workflows/site-build.yml | 29 ++++++++++++++++++++++++ .github/workflows/site-test.yml | 38 -------------------------------- 2 files changed, 29 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/site-build.yml delete mode 100644 .github/workflows/site-test.yml diff --git a/.github/workflows/site-build.yml b/.github/workflows/site-build.yml new file mode 100644 index 000000000..5b965df05 --- /dev/null +++ b/.github/workflows/site-build.yml @@ -0,0 +1,29 @@ +name: Site Build + +on: + pull_request: + branches: + - main + paths: + - '.github/workflows/site-build.yml' + - 'website/**' + +jobs: + site-build: + name: Site Build + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./website + steps: + - uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: ./website/package-lock.json + + - run: npm install --frozen-lockfile + - run: npm run build diff --git a/.github/workflows/site-test.yml b/.github/workflows/site-test.yml deleted file mode 100644 index 83754ab0d..000000000 --- a/.github/workflows/site-test.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Site Test - -on: - pull_request: - branches: - - main - paths: - - '.github/workflows/test-deploy.yml' - - 'website/**' - -jobs: - test-deploy: - name: Site Test - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./website - steps: - - uses: actions/checkout@v3 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: '20' - - - name: Get yarn cache - id: yarn-cache - run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}" - - - name: Cache dependencies - uses: actions/cache@v3 - with: - path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }} - key: ${{ runner.os }}-website-${{ hashFiles('**/yarn.lock') }} - restore-keys: ${{ runner.os }}-website- - - - run: yarn install --frozen-lockfile - - run: yarn build From dcf562107ae68dc61e9ee93da5d6d9755c62e835 Mon Sep 17 00:00:00 2001 From: Sagar Lakshmipathy <18vidhyasagar@gmail.com> Date: Tue, 7 Nov 2023 18:40:58 -0800 Subject: [PATCH 4/4] Test commit --- .github/workflows/site-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/site-build.yml b/.github/workflows/site-build.yml index 5b965df05..7fff9fcd1 100644 --- a/.github/workflows/site-build.yml +++ b/.github/workflows/site-build.yml @@ -27,3 +27,4 @@ jobs: - run: npm install --frozen-lockfile - run: npm run build +