From 37d32bdfc8f77e7b0d479262b2b10887f1f18c3d Mon Sep 17 00:00:00 2001 From: Bart Huijgen Date: Mon, 14 Nov 2022 11:55:29 +0100 Subject: [PATCH] feat: upgrade to build in caching in actions and upgrade to node 18 --- .github/workflows/deploy_dev.yml | 15 +++------------ .github/workflows/deploy_prd.yml | 15 +++------------ .github/workflows/validate.yml | 17 ++++------------- blueprints.Dockerfile | 4 ++-- blueprints.github.Dockerfile | 2 +- 5 files changed, 13 insertions(+), 40 deletions(-) diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index 79248f1..9e5a383 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -13,18 +13,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 14 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn + node-version: 18 + cache: "yarn" + - run: yarn --prefer-offline - run: yarn nx build blueprints env: CF_WEB_ANALYTICS: 6c563c1e5db141129a5fc95d5c459722 diff --git a/.github/workflows/deploy_prd.yml b/.github/workflows/deploy_prd.yml index 2df15ef..12b6e58 100644 --- a/.github/workflows/deploy_prd.yml +++ b/.github/workflows/deploy_prd.yml @@ -13,18 +13,9 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 14 - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v3 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - run: yarn + node-version: 18 + cache: "yarn" + - run: yarn --prefer-offline - run: yarn nx build blueprints env: PUBLIC_URL: https://factorio-blueprints-assets.storage.googleapis.com/public diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 5630e9d..c857a47 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -6,20 +6,11 @@ jobs: validate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: "14.x" - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + node-version: 18 + cache: "yarn" - run: yarn --prefer-offline - run: yarn nx run-many --all --target=lint - run: yarn nx run-many --all --target=test "--ci" diff --git a/blueprints.Dockerfile b/blueprints.Dockerfile index 6628613..e9b0e39 100644 --- a/blueprints.Dockerfile +++ b/blueprints.Dockerfile @@ -1,4 +1,4 @@ -FROM node:14-slim as builder +FROM node:18-slim as builder RUN apt-get -qy update && apt-get -qy install openssl @@ -15,7 +15,7 @@ COPY . . RUN yarn nx build blueprints --prod -FROM node:14-slim +FROM node:18-slim RUN apt-get -qy update && apt-get -qy install openssl diff --git a/blueprints.github.Dockerfile b/blueprints.github.Dockerfile index 2d90d71..16dc5fe 100644 --- a/blueprints.github.Dockerfile +++ b/blueprints.github.Dockerfile @@ -1,4 +1,4 @@ -FROM node:14-slim +FROM node:18-slim RUN apt-get -qy update && apt-get -qy install openssl