Skip to content

Commit

Permalink
chore:Added stage CI/CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
SethK committed Mar 28, 2024
1 parent f5d5cdb commit 85d2b0a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/deploy_stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: filestack-js-stage
on:
push:
branches: [ stage ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup repository env
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: "https://registry.npmjs.org"
- name: Install deps
run: npm install --ignore-scripts
- name: Run tests
run: npm test
- name: Prepare docs
run: npm run docs
- name: Publish package to cdn - stage version
run: npm run publish:s3:stage
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"release": "standard-version",
"prepare": "npm run build",
"publish:s3:beta": "npm run build && node scripts/publish.js --beta",
"publish:s3:stage": "npm run build && node scripts/publish.js --stage",
"publish:s3": "node scripts/publish.js --current --latest",
"cache:clean": "node scripts/cache.js --current --latest",
"cache:clean:beta": "node scripts/cache.js --beta",
Expand Down
5 changes: 5 additions & 0 deletions scripts/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,10 @@ const purge = (bucket, path) => {
paths.push(`filestack-js/beta`)
}

if (args.indexOf('--stage') > -1) {
console.log(`clearing cache for stage version`);
paths.push(`filestack-js/stage`)
}

Promise.all(paths.map((p) => purge(bucket, p)), (res) => console.log(res))
})();
9 changes: 9 additions & 0 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,14 @@ const upload = async (bucket, path, cacheControll) => {
})
}

if (args.indexOf('--stage') > -1) {
console.log(`publish stage version`);
paths.push({
bucket,
path: `filestack-js/stage`,
cacheControll: 0
})
}

Promise.all(paths.map((data) => upload(data.bucket, data.path, data.cacheControll))).then((res) => console.log(res))
})();
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* @private
*/
const PICKER_VERSION = '1.26.2';
const PICKER_VERSION = 'stage';

/**
* @private
Expand Down

0 comments on commit 85d2b0a

Please sign in to comment.