add images test #5
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 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://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Node.js CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: create env file | |
run: | | |
touch .env | |
echo ACCESS_TOKEN_SECRET=${{ secrets.ACCESS_TOKEN_SECRET }} >> .env | |
echo DB_DIALECT=${{ secrets.DB_DIALECT }} >> .env | |
echo DB_HOST=${{ secrets.DB_HOST }} >> .env | |
echo DB_NAME=${{ secrets.DB_NAME }} >> .env | |
echo DB_PASSWORD=${{ secrets.DB_PASSWORD }} >> .env | |
echo DB_PORT=${{ secrets.DB_PORT }} >> .env | |
echo DB_USER=${{ secrets.DB_USER }} >> .env | |
echo PORT=${{ secrets.PORT }} >> .env | |
echo REFRESH_TOKEN_SECRET=${{ secrets.REFRESH_TOKEN_SECRET }} >> .env | |
echo SESS_SECRET=${{ secrets.SESS_SECRET }} >> .env | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- run: npm ci | |
- run: pm2 stop portfolio-backend | |
- run: pm2 delete portfolio-backend | |
- run: pm2 start index.js --name "portfolio-backend" |