From 1ffde0391ea34325ea94d5fb6885e66652bb4ad4 Mon Sep 17 00:00:00 2001 From: IanM <16573496+imorland@users.noreply.github.com> Date: Wed, 22 Mar 2023 18:00:50 +0000 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 38 ++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 922964e..a5d4493 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,32 @@ -name: Build JavaScript assets +name: JavaScript on: - push: - branches: - - master + push: + branches: + - master jobs: - build: - runs-on: ubuntu-latest + build: + name: JS / Build + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: flarum/action-build@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Restore npm cache + uses: actions/cache@v3 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('js/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + # Our action will install npm, cd into `./js`, run `npm run build` and + # `npm run build-typings`, then commit and upload any changes + - name: Build production JS + uses: flarum/action-build@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + build_script: build + package_manager: npm