-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodefresh.yml
More file actions
68 lines (60 loc) · 1.7 KB
/
Copy pathcodefresh.yml
File metadata and controls
68 lines (60 loc) · 1.7 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# this pipeline should not be run on version tag releases (it may cause a non correct sha to override version tagged image in dockerhub)
version: "1.0"
stages:
- CI
- CD
steps:
main_clone:
title: Cloning main repository...
type: git-clone
repo: '${{CF_REPO_OWNER}}/${{CF_REPO_NAME}}'
revision: '${{CF_REVISION}}'
install_dependencies:
title: 'Installing testing dependencies'
stage: CI
image: codefresh/build-cli
commands:
- yarn install --frozen-lockfile
eslint:
title: 'Running linting logic'
stage: CI
image: codefresh/build-cli
commands:
- yarn eslint
unit-tests:
stage: CI
title: 'Running unit tests'
image: codefresh/build-cli
commands:
- yarn test
add_git_tag:
title: "Add Git tag"
stage: CD
image: codefresh/cli
commands:
- 'apk update && apk add jq'
- 'export PACKAGE_VERSION=$(jq -r ".version" package.json)'
- "echo Current version: $PACKAGE_VERSION"
- "cf_export PACKAGE_VERSION"
- "git tag $PACKAGE_VERSION"
when:
branch:
only: [ master ]
create_release:
stage: CD
title: "Create github release"
image: codefresh/build-cli
commands:
- 'curl --fail -X POST -d ''{"tag_name":"v${{PACKAGE_VERSION}}","target_commitish":"${{CF_REVISION}}","name":"Codefresh V${{PACKAGE_VERSION}}"}'' -H "Content-Type: application/json" -H "Authorization: token ${{GITHUB_TOKEN}}" https://api.github.com/repos/codefresh-io/js-sdk/releases'
when:
branch:
only: [ master ]
deploy_to_npm:
stage: CD
type: npm-publish
arguments:
NPM_TOKEN: '${{NPM_TOKEN}}'
DIR: '${{CF_REPO_NAME}}'
when:
branch:
only: [ master ]