WIP: Build & Release

This commit is contained in:
Michał Zieliński
2025-02-12 18:51:37 +01:00
parent 466c08f8e4
commit 201fe7e14a
2 changed files with 14 additions and 8 deletions

View File

@@ -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');
});
}

View File

@@ -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