Update workflow to remove pre-script nx affected

This commit is contained in:
Edd 2022-04-11 18:55:59 +01:00
parent bfdb1e0b62
commit 47f1f73582
2 changed files with 6 additions and 1 deletions

View File

@ -25,4 +25,4 @@ jobs:
with:
node-version: 16.14.0
- name: Run deploy for affected sites
run: yarn nx print-affected --base=origin/master~1 --head=origin/master --select=projects | ./tools/ipfs-deploy.js
run: ./tools/ipfs-deploy.js

View File

@ -33,6 +33,11 @@ function getFleekLastBuildCommit(siteId) {
return commit;
}
/**
* Triggers a Fleek build of the latest code via GraphQL
* @param {String} siteId
* @returns
*/
function triggerDeploy(siteId) {
const curl = `curl 'https://api.fleek.co/graphql' --silent -X POST -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Authorization: ${process.env['FLEEK_API_KEY']}' --data-raw '{"query":"mutation {triggerDeploy(commit: \\"HEAD\\", siteId: \\"${siteId}\\"){status}}","variables":null}'`;
const fleekRes = execSync(curl);