-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.77 KB
/
npm-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# 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: Access Environment Variable
run: echo "ATLAS_URI:$ATLAS_URI"
- name: Direct Access Environment Variable
run: echo "ATLAS_URI:${{ secrets.ATLAS_URI }}"
- name: create env file
run: |
echo "___________"
touch .env
echo ATLAS_URI: $ATLAS_URI >> .env
echo "##################"
cat .env
echo "____________"
ls
echo "____________"
- name: Navigate to server directory
run: ls && pwd
- 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 ci
- run: |
touch .env
echo ATLAS_URI1: ${{ secrets.ATLAS_URI }} >> .env
echo "____________"
cat .env
ls -A
pm2 list
# pm2 logs backendserver --lines 40
# pm2 restart backendserver --update-env