Successful debug and fixed env #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
name: Node.js XCLONE | |
on: | |
workflow_call: | |
inputs: | |
node-version: | |
description: Node version | |
type: string | |
required: true | |
working-directory: | |
description: Working directory to use | |
type: string | |
default: ./x-clone-backend | |
push: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: self-hosted | |
defaults: | |
run: | |
working-directory: ./x-clone-backend | |
strategy: | |
matrix: | |
node-version: [18.x] | |
env: | |
ATLAS_URI: ${{ secrets.ATLAS_URI }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Create env file and Navigate to server directory | |
run: | | |
echo "___________" | |
echo "#########>Creating File<#########" | |
touch .env | |
echo ATLAS_URI: $ATLAS_URI >> .env | |
echo ATLAS_URI1: ${{ secrets.ATLAS_URI }} >> .env | |
echo "#########>File Created<#########" | |
echo "#########>Reading Content<#########" | |
cat .env | |
echo "____________" | |
ls -A | |
echo "____________" | |
pwd | |
echo "____________" | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://npm.pkg.github.com' | |
- run: npm cache clean --force | |
- run: npm ci | |
- run: | | |
echo "____________" | |
cat .env | |
ls -A | |
echo "#########>pm2 commands below<#########" | |
pm2 list | |
pm2 logs backendserver --lines 40 | |
pm2 restart backendserver --update-env |