Pipeline actions deprecated (Node.js 12) - node.js

I'm currently setting up a simple CI pipeline for a project on Github but I've run into a problem. When I run a Selene Lint check, my code does get successfully integrated but I get this warning:
Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
Please update the following actions to use Node.js 16: Roblox/setup-foreman#v1
Here is my ci.yaml:
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Selene Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout#v3
- uses: Roblox/setup-foreman#v1
name: Install Foreman
with:
version: "^1.0.0"
token: ${{ SECRETS.GITHUB_TOKEN }}
- name: Selene Lint
run: |
selene ./src
Does anyone know how I can set up Foreman using Node.js 16?
Unfortunately, this is my first time setting up a CI Pipeline so I am not to familiar with how to approach this issue.

Related

GitHub Actions to build artifact and deploy

I am using a github action pipeline and am trying to run an "npm run build" to generate an artifact that will then be used for deployment and production. Right now, my application is loaded from the local /build folder containing the built production application. This folder is populated after i make my changes and manually run "npm run build." I would instead like my pipeline to build the artifact and then deploy the application from artifact in Heroku. Here is my pipeline code:
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout#v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
# - run: npm ci
# - run: npm run build --if-present
- run: cd react-frontend && npm install
- run: cd react-frontend && npm run build
# - run: npm test --if-present ```
No artifact is being built at present

Github Actions not working giving error Invalid type for `on`

When I am pushing my project on github it pipeline should work but it's telling Invalid type for on
name: NASA Project CI
on:
push: branches:[master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- name: Use Node.js version 16
- uses: actions/setup-node#v2
with: node-version:'16'
- run: npm install
- run: npm run build --prefix client
YAML, the format that GitHub uses for Actions, is sensitive to space and indentation. You'll probably want to write the push: entries on separate lines, indented, like so:
name: NASA Project CI
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- name: Use Node.js version 16
- uses: actions/setup-node#v2
with: node-version:'16'
- run: npm install
- run: npm run build --prefix client

Azure Web application deployment successful, but does not update the web application

Previously I was having an error with the deployment of my React application on Web Service Linux on Azure. This problem was solved in the previous post I did, follow the link:
My Azure Web Application on Linux is not working. The error message on azure logs "react-scripts: not found" and github "npm ERR! code ELIFECYCLE ”.
Now I am having another problem which consists of the following:
After deploying to the Azure platform (I'm using the github option for deployment) and receiving a successful deployment notification, upon entering my github repository, I received the error
"npm ERR! Code ELIFECYCLE" (follow the link to view the entire log: https://mega.nz/folder/eth0WSiL#pGvXl2yShQfUrNELCKD3cA). Upon entering the application and testing it I noticed that the deployment really did not work.
An important point worth mentioning that in the previous problem the solution passed by #JasonPan worked, but when we tested it I still used the Azure classic
deployment center, which was removed a few days ago and after trying to use the current deployment center I came across this error.
I managed to solve the problem. I needed to do two things within my .yml file, they were:
add a CI: false and remove the npm run test
Here is the code:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- name: Set up Node.js version
uses: actions/setup-node#v1
with:
node-version: '14.x'
- name: npm install, build
run: |
npm install
npm run build --if-present
- name: Upload artifact for deployment job
uses: actions/upload-artifact#v2
with:
name: node-app
path: .
deploy:
runs-on: ubuntu-latest
needs: build
environment:
CI: false
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
The .yml file before it was changed:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- name: Set up Node.js version
uses: actions/setup-node#v1
with:
node-version: '14.x'
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
- name: Upload artifact for deployment job
uses: actions/upload-artifact#v2
with:
name: node-app
path: .
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

Unable to test electron desktop application on GitHub-Action Workflow "exited with signal SIGABRT"

I have made simple hello world Desktop Application using electron framework.
and it's working locally fine but it's failing GitHub Action CI.
link to action
link to yaml
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node-version }}
- name: getting node js
run: sudo npm install npm#latest -g
- name: setting electron globally
run: npm i electron -g
- name: running application.
run: electron .
- name: all done just checks passed.
run: echo ci done successfully.
I'm getting following error in GitHub action console help me out which command is missing or anything that fixies this issue. I have tried npm init also.
run electron .
The futex facility returned an unexpected error code./opt/hostedtoolcache/node/10.23.0/x64/lib/node_modules/electron/dist/electron exited with signal SIGABRT
Error: Process completed with exit code 1.
please avoid spelling mistakes.
thanks in advance.

How to make npm run build on local machine with help of github actions?

I have a Nuxt Js application on my ubuntu server. I use my terminal to enter server and run commands on my server. I can't run command "npm run build" because my VPS has low memory and build command freezes.So I decided to make build on my PC, copy built folder to VPS and then run application.
What should I write in github actions to perform those steps?
-npm run build
-copy built folder from my machine to VPS using ssh(or password, it doesn't matter) to specific folder on VPS
What I did last time and it worked for me:
name: Deployment Setup
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
job-one:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Testing VPS connection and deploy project
uses: appleboy/ssh-action#master
with:
host: 114.12.587.105
port: 1234
username: new-user
key: ${{ secrets.PRIVATE_KEY}}
uses: appleboy/ssh-action#master
script: |
cd /home/kentforth/webapps/myapp
git pull
npm install --production
quasar build
sudo service nginx restart
EDIT:
Here is my deploy.yml file:
name: 'test my project'
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node-version }}
- run: npm run build
Here is What I get in github actions:
It seems github actions try to find path /home/runner/work/my project name
But I do not have such directory
How can specify I the folder on my local machine where "npm run build" command should run?

Resources