Skip to content

chore(deps): update react monorepo to v18 (major) #3155

chore(deps): update react monorepo to v18 (major)

chore(deps): update react monorepo to v18 (major) #3155

Workflow file for this run

name: Build & Deploy to Netlify
# https://qiita.com/nwtgck/items/e9a355c2ccb03d8e8eb0
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: 12.x
- name: Output current branch name
uses: satackey/[email protected]
id: names
with:
required-packages: actions-exec-listener @actions/exec @actions/core
event: ${{ github.event_name }}
script: |
const core = require('@actions/core')
const exec = require('actions-exec-listener')
const eventName = core.getInput('event')
const token = eventName === 'pull_request' ? process.env.GITHUB_TOKEN : ''
core.setOutput('notif-token', token)
const cacheDir = (await exec.exec('yarn cache dir')).stdoutStr
core.setOutput('yarn-cache', cacheDir)
- name: Restore yarn cache
uses: actions/cache@v4
with:
path: ${{ steps.names.outputs.yarn-cache }}
key: ${{ runner.OS }}-yarn-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-${{ hashFiles('package.json') }}-
${{ runner.OS }}-yarn-
# - name: Restore Gatsby build cache
# uses: actions/cache@v1
# with:
# path: .cache
# key: ${{ runner.OS }}-gatsby-${{ hashFiles('**.md') }}-${{ hashFiles('package.json') }}-${{ hashFiles('yarn.lock') }}
# restore-keys: |
# ${{ runner.OS }}-gatsby-${{ hashFiles('**.md') }}-${{ hashFiles('package.json') }}-
# ${{ runner.OS }}-gatsby-${{ hashFiles('**.md') }}-
# ${{ runner.OS }}-gatsby-
- name: Install dependencies
run: yarn install --frozen-lockfile
# - name: Run test
# run: yarn test
- name: Build
run: yarn build
- name: Deploy
uses: nwtgck/[email protected]
if: github.event_name == 'pull_request' || contains(github.ref, 'master')
with:
publish-dir: public
production-branch: master
github-token: ${{ steps.names.outputs.notiftoken }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}