diff --git a/.github/workflows/buildScripts/replaceTokens.js b/.github/workflows/buildScripts/replaceTokens.js index bb993f8..bf131a7 100644 --- a/.github/workflows/buildScripts/replaceTokens.js +++ b/.github/workflows/buildScripts/replaceTokens.js @@ -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'); }); } diff --git a/.github/workflows/release-morska.yml b/.github/workflows/release-morska.yml index a4df05a..703c7ef 100644 --- a/.github/workflows/release-morska.yml +++ b/.github/workflows/release-morska.yml @@ -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 \ No newline at end of file