Skip to content

Commit 85d2b0a

Browse files
author
SethK
committed
chore:Added stage CI/CI pipeline
1 parent f5d5cdb commit 85d2b0a

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

.github/workflows/deploy_stage.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: filestack-js-stage
2+
on:
3+
push:
4+
branches: [ stage ]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Setup repository env
11+
uses: actions/setup-node@v1
12+
with:
13+
node-version: '14.x'
14+
registry-url: "https://registry.npmjs.org"
15+
- name: Install deps
16+
run: npm install --ignore-scripts
17+
- name: Run tests
18+
run: npm test
19+
- name: Prepare docs
20+
run: npm run docs
21+
- name: Publish package to cdn - stage version
22+
run: npm run publish:s3:stage
23+
env:
24+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
25+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
26+
AWS_REGION: ${{ secrets.AWS_REGION }}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"release": "standard-version",
3232
"prepare": "npm run build",
3333
"publish:s3:beta": "npm run build && node scripts/publish.js --beta",
34+
"publish:s3:stage": "npm run build && node scripts/publish.js --stage",
3435
"publish:s3": "node scripts/publish.js --current --latest",
3536
"cache:clean": "node scripts/cache.js --current --latest",
3637
"cache:clean:beta": "node scripts/cache.js --beta",

scripts/cache.js

+5
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,10 @@ const purge = (bucket, path) => {
6161
paths.push(`filestack-js/beta`)
6262
}
6363

64+
if (args.indexOf('--stage') > -1) {
65+
console.log(`clearing cache for stage version`);
66+
paths.push(`filestack-js/stage`)
67+
}
68+
6469
Promise.all(paths.map((p) => purge(bucket, p)), (res) => console.log(res))
6570
})();

scripts/publish.js

+9
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,14 @@ const upload = async (bucket, path, cacheControll) => {
118118
})
119119
}
120120

121+
if (args.indexOf('--stage') > -1) {
122+
console.log(`publish stage version`);
123+
paths.push({
124+
bucket,
125+
path: `filestack-js/stage`,
126+
cacheControll: 0
127+
})
128+
}
129+
121130
Promise.all(paths.map((data) => upload(data.bucket, data.path, data.cacheControll))).then((res) => console.log(res))
122131
})();

src/config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* @private
2020
*/
21-
const PICKER_VERSION = '1.26.2';
21+
const PICKER_VERSION = 'stage';
2222

2323
/**
2424
* @private

0 commit comments

Comments
 (0)