WIP: Build & Release
This commit is contained in:
11
.github/workflows/buildScripts/replaceTokens.js
vendored
11
.github/workflows/buildScripts/replaceTokens.js
vendored
@@ -1,5 +1,5 @@
|
||||
module.exports = async ({ github, context, core, jobId }) => {
|
||||
/*
|
||||
|
||||
const frontendPath = `./${jobId}/frontend/diunaBI/browser/`;
|
||||
const files = (require('fs').readdirSync(frontendPath).filter(file => file.endsWith('.js')))
|
||||
.map(file => `${frontendPath}${file}`);
|
||||
@@ -7,11 +7,9 @@ module.exports = async ({ github, context, core, jobId }) => {
|
||||
core.setFailed("Frontend JS files not found");
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
|
||||
const files = [];
|
||||
|
||||
files.push(`./${jobId}/webapi/appsettings.json`);
|
||||
//files.push(`./${jobId}/webapi/client_secrets.json`);
|
||||
files.push(`./${jobId}/webapi/client_secrets.json`);
|
||||
|
||||
files.forEach(file => {
|
||||
let data = require('fs').readFileSync(file, 'utf8');
|
||||
@@ -26,10 +24,7 @@ module.exports = async ({ github, context, core, jobId }) => {
|
||||
return false;
|
||||
}
|
||||
data = data.replace(new RegExp(original, 'g'), value);
|
||||
console.log(`Replaced ${original} with ${value} (${token}) in ${file}`);
|
||||
console.log(data);
|
||||
}
|
||||
console.log(data);
|
||||
require('fs').writeFileSync(file, data, 'utf8');
|
||||
});
|
||||
}
|
||||
|
||||
11
.github/workflows/release-morska.yml
vendored
11
.github/workflows/release-morska.yml
vendored
@@ -96,3 +96,14 @@ jobs:
|
||||
chmod 600 private_key
|
||||
scp -i private_key -o StrictHostKeyChecking=no ./${{env.job_id}}/morska-webapi.zip mz@crm.bim-it.pl:
|
||||
rm private_key
|
||||
|
||||
- name: Run SSH commands on remote server
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.PROD_SRV_PRIVATE_KEY }}
|
||||
run: |
|
||||
echo "${SSH_PRIVATE_KEY}" > private_key
|
||||
chmod 600 private_key
|
||||
ssh -i private_key -o StrictHostKeyChecking=no mz@crm.bim-it.pl << 'EOF'
|
||||
./deploy.sh
|
||||
EOF
|
||||
rm private_key
|
||||
Reference in New Issue
Block a user