-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (41 loc) · 1.26 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: DS Api client
on: pull_request
jobs:
tests:
name: Run unit tests
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Checks-out repository
uses: actions/checkout@v3
- name: Use Node.js 16.x.x
uses: actions/setup-node@v3
with:
node-version: "16"
- name: run test unit
env:
API_URL: ${{secrets.API_URL}}
API_TOKEN: ${{secrets.API_TOKEN}}
NODE_TLS_REJECT_UNAUTHORIZED: 0
run: |
npm ci
npm run lint
API_URL=${{secrets.API_URL}}; API_TOKEN=${{secrets.API_TOKEN}}; npm run test
- name: run build
run: npm run build
- name: prepare deploy
if: ${{ github.base_ref == 'dev' || github.base_ref == 'main' }}
run: |
mkdir target
cp -r dist target/.
cp package.json target/.
cp README.md target/.
cp -r src target/.
- name: Deploy
if: ${{ github.base_ref == 'dev' || github.base_ref == 'main' }}
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: dev-release/test-1
FOLDER: target
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}