From 1042985009f6b18f258db9e90cfdcb9f87031cc2 Mon Sep 17 00:00:00 2001
From: TO
Date: Sun, 14 Apr 2024 20:01:36 +0200
Subject: [PATCH] move useless workflow to a new job
---
.github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++--------
.github/workflows/validate.yml | 30 ------------------------------
2 files changed, 26 insertions(+), 38 deletions(-)
delete mode 100644 .github/workflows/validate.yml
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 60e2015..44f660d 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -1,17 +1,34 @@
-name: Deploy
+# 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: deploy
-# run after validate workflow has completed and the current branch is 'beta'
on:
- workflow_run:
- workflows: ['validate']
- types: [completed]
- branches:
- - 'main'
+ push:
+ branches: [ "main" ]
+ pull_request:
+ branches: [ "main" ]
jobs:
+ validate:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ node-version: [18.x, 20.x, 21.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
+
deploy:
- name: deploy
+ needs: validate
runs-on: ubuntu-latest
steps:
- name: executing remote ssh commands using password
@@ -22,3 +39,4 @@ jobs:
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: cd /home/nessar/portfolio/ ; ./installRelease.sh
+
diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml
deleted file mode 100644
index 5dc2960..0000000
--- a/.github/workflows/validate.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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: ubuntu-latest
-
- strategy:
- matrix:
- node-version: [18.x, 20.x, 21.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