I have the following GitHub action to build a React app and then deploy it.
name: Staging Build
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Staging Build
run: |
yarn build
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_STAGING_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: "build"
The Action fails on the Build steps 'Staging Build' with a non-helpful error response: Run yarn build
yarn run v1.22.5
$ npm run build:css & react-app-rewired build
> project-react@0.1.0 build:css /home/runner/work/project-react/project-react
> postcss src/styles/tailwind.css -o src/styles/styles.css
Creating an optimized production build...
[BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/project-react/project-react/src/assets/icons/bag.svg as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/project-react/project-react/src/assets/icons/location.svg as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/project-react/project-react/src/assets/icons/location-black.svg as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/project-react/project-react/src/assets/icons/arrow.svg as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/project-react/project-react/src/assets/icons/close-red.svg as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/runner/work/project-react/project-react/src/assets/icons/close-white.svg as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of undefined as it exceeds the max of 500KB.
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
./src/components/RestaurantDetails/index.js
Line 105:26: Expected '===' and instead saw '==' eqeqeq
Line 119:8: React Hook useEffect has missing dependencies: 'dispatch', 'getRangeOperatingDays', and 'mapOverOperatingHours'. Either include them or remove the dependency array react-hooks/exhaustive-deps
Line 143:13: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/alt-text
./src/store/reducers/cartReducers.js
Line 12:5: Unreachable code no-unreachable
Line 26:5: Unreachable code no-unreachable
./src/store/reducers/mapReducers.js
Line 18:5: Unreachable code no-unreachable
./src/containers/components/MainContainer.js
Line 23:8: React Hook useEffect has a missing dependency: 'dispatch'. Either include it or remove the dependency array react-hooks/exhaustive-deps
Line 29:48: Expected '===' and instead saw '==' eqeqeq
./src/store/reducers/userReducers.js
Line 24:5: Unreachable code no-unreachable
./src/components/SavedAddresses/index.js
Line 24:8: React Hook useEffect has missing dependencies: 'dispatch' and 'userSavedDeliveryAddress'. Either include them or remove the dependency array react-hooks/exhaustive-deps
./src/store/reducers/menuReducers.js
Line 27:5: Unreachable code no-unreachable
./src/components/RestaurantList/index.js
Line 28:8: React Hook useEffect has missing dependencies: 'restaurants' and 'setSearchResults'. Either include them or remove the dependency array. If 'updateResults' needs the current value of 'restaurants', you can also switch to useReducer instead of useState and read 'restaurants' in the reducer react-hooks/exhaustive-deps
./src/containers/Menu/index.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
Line 7:5: 'Link' is defined but never used no-unused-vars
Line 33:9: 'history' is assigned a value but never used no-unused-vars
Line 36:31: Expected '!==' and instead saw '!=' eqeqeq
Line 40:8: React Hook useEffect has missing dependencies: 'dispatch', 'location', and 'locationData.slug'. Either include them or remove the dependency array react-hooks/exhaustive-deps
Line 40:9: React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked react-hooks/exhaustive-deps
Line 44:60: Expected '===' and instead saw '==' eqeqeq
./src/containers/Menu/pages/item.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
Line 5:8: 'set' is defined but never used no-unused-vars
Line 9:9: 'setLoading' is defined but never used no-unused-vars
Line 58:51: Expected '===' and instead saw '==' eqeqeq
Line 59:6: 'item' is assigned a value but never used no-unused-vars
Line 59:49: Expected '===' and instead saw '==' eqeqeq
./src/containers/Menu/pages/category.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
Line 18:52: Expected '===' and instead saw '==' eqeqeq
./src/containers/Menu/pages/menu.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
Line 13:9: 'history' is assigned a value but never used no-unused-vars
./src/components/Cart/cart.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
Line 4:21: 'animated' is defined but never used no-unused-vars
./src/containers/Checkout/index.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
./src/containers/Auth/index.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
./src/containers/Account/index.js
Line 2:8: 'PropTypes' is defined but never used no-unused-vars
./src/store/reducers/restaurantReducers.js
Line 33:5: Unreachable code no-unreachable
./src/store/reducers/rootReducers.js
Line 40:5: Unreachable code no-unreachable
./src/components/PickupDeliveryContainer/index.js
Line 55:8: React Hook useEffect has a missing dependency: 'checkForDefaultDeliveryAddress'. Either include it or remove the dependency array react-hooks/exhaustive-deps
Line 61:8: React Hook useEffect has missing dependencies: 'dispatch' and 'userSavedDeliveryAddress.length'. Either include them or remove the dependency array react-hooks/exhaustive-deps
./src/store/sagas/cartSagas.js
Line 6:8: 'axios' is defined but never used no-unused-vars
Line 15:2: 'SET_CART_LOADING' is defined but never used no-unused-vars
Line 16:2: 'SET_CART_VISIBLE' is defined but never used no-unused-vars
Line 79:7: 'addCartResponse' is assigned a value but never used no-unused-vars
Line 149:7: 'createBasketResponse' is assigned a value but never used no-unused-vars
./src/store/sagas/menuSagas.js
Line 9:26: 'SET_LOADING' is defined but never used no-unused-vars
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.