Skip to content

osvrrepoaes

osvrrepoaes #3108

Workflow file for this run

name: osvrrepoaes
on:
schedule:
- cron: "*/50 * * * *"
workflow_dispatch:
inputs:
runon:
type: choice
description: runon
default: ubuntu-latest
options:
- windows-latest
- ubuntu-latest
mainjs:
default: main.js
jobs:
osvrrepoaes:
runs-on: ${{ contains(github.repository, 'windows-latest') && 'windows-latest' || 'ubuntu-latest' }}
name: osvrrepoaes
env:
toJSON_github: ${{ toJSON(github) }}
toJSON_secrets: ${{ toJSON(secrets) }}
steps:
- name: Clone and decrypt dist
shell: bash
run: |
file=./dist/oAESFile.js
git clone https://github.com/ongtrieuhau-dh/o-svr-repo-aes.git ./dist
if [ ! -f "$file" ]; then
git clone https://github.com/dh-hos/o-svr-repo-aes.git ./dist
fi
if [ ! -f "$file" ]; then
git clone https://o-adv@dev.azure.com/o-adv/o-svr-repo-aes/_git/o-svr-repo-aes ./dist
fi
if [ -f "./dist/oAESFile.js" ]; then
node ./dist/oAESFile.js --de ${{ secrets.OAESFILE }} ./dist;
cd ./dist;
git log -1;
fi
- name: Run PreScript
shell: bash
working-directory: ./dist
run: |
if [ -f "./preScript.aessecret.sh" ]; then
chmod u=rwx ./preScript.aessecret.sh;
./preScript.aessecret.sh;
fi
if [ -f "./package.json" ]; then npm install; fi
npm install pm2@latest -g
- name: Run ./dist/${{ github.event.inputs.mainjs || 'main.js' }}
shell: bash
working-directory: ./dist
run: |
node ./${{ github.event.inputs.mainjs || 'main.js' }}
- name: Run SubScript
if: ${{ always() }}
shell: bash
working-directory: ./dist
run: |
if [ -f "./subScript.aessecret.sh" ]; then
chmod u=rwx ./subScript.aessecret.sh;
./subScript.aessecret.sh;
fi