Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleClapton committed Nov 1, 2024
1 parent 154cce3 commit cbc4206
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 98 deletions.
58 changes: 9 additions & 49 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Read `.nvmrc`
run: echo "::set-output name=nvmrc::$(cat .nvmrc)"
id: nvm
uses: actions/checkout@v4

- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.nvmrc }}"

- name: Read `yarn cache dir`
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Load yarn cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Load Next.js cache
uses: actions/cache@v2
uses: actions/setup-node@v4
with:
path: ${{ github.workspace }}/dist/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-nextjs-
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable
Expand Down Expand Up @@ -72,7 +48,7 @@ jobs:
yarn.lock
- name: Publish artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: fuelrats-com
path: fuelrats-com.tar.gz
Expand All @@ -87,7 +63,7 @@ jobs:

steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: fuelrats-com

Expand All @@ -96,27 +72,11 @@ jobs:
tar -xzf fuelrats-com.tar.gz
rm fuelrats-com.tar.gz
- name: Read `.nvmrc`
run: echo "::set-output name=nvmrc::$(cat .nvmrc)"
id: nvm

- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.nvmrc }}"

- name: Read `yarn cache dir`
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Load yarn cache
uses: actions/cache@v2
id: yarn-cache
uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable
Expand Down
59 changes: 10 additions & 49 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,78 +11,39 @@ jobs:
name: Lint
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Read `.nvmrc`
run: echo "::set-output name=nvmrc::$(cat .nvmrc)"
id: nvm
uses: actions/checkout@v4

- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: "${{ steps.nvm.outputs.nvmrc }}"

- name: Read `yarn cache dir`
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Load yarn cache
uses: actions/cache@v2
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-file: '.nvmrc'
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

- name: Lint
uses: wearerequired/lint-action@v1.9.0
uses: wearerequired/lint-action@v2.3.0
with:
github_token: ${{ secrets.github_token }}
eslint: true
eslint_args: "--max-warnings 0"
stylelint: true
stylelint_args: "--max-warnings 0"
stylelint_extensions: "css,sass,scss"

build:
runs-on: ubuntu-latest
name: Build Test
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Read `.nvmrc`
run: echo "::set-output name=nvmrc::$(cat .nvmrc)"
id: nvm
uses: actions/checkout@v4

- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v1
with:
node-version: "${{ steps.nvm.outputs.nvmrc }}"

- name: Read `yarn cache dir`
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- name: Load yarn cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Load Next.js cache
uses: actions/cache@v2
uses: actions/setup-node@v4
with:
path: ${{ github.workspace }}/dist/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-nextjs-
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable
Expand Down

0 comments on commit cbc4206

Please sign in to comment.