diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 54d7e52..823c9ba 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -21,15 +21,23 @@ jobs: node-version: lts/* cache: 'yarn' + - name: Install yarn + run: npm install -g yarn + - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - - name: Install yarn + - name: Install front-end dependancies if: steps.yarn-cache.outputs.cache-hit != 'true' - run: npm install -g yarn + run: yarn install - - uses: actions/cache@v3 + - name: Install process manager + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn add pm2 + + - name: Cache yarn + uses: actions/cache@v3 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} @@ -37,6 +45,9 @@ jobs: restore-keys: | ${{ runner.os }}-yarn- + - name: Build front-end + run: yarn build:dev + - name: Cache NextJS uses: actions/cache@v3 with: @@ -50,17 +61,6 @@ jobs: restore-keys: | ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - - name: Install front-end dependancies - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn install - - - name: Install process manager - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn add pm2 - - - name: Build front-end - run: yarn build:dev - - name: Setup python uses: actions/setup-python@v2