14
14
name : Lint Code Base
15
15
runs-on : ubuntu-latest
16
16
steps :
17
- - name : Checkout Code
17
+ - name : Checkout Code (Lint)
18
18
uses : actions/checkout@v2
19
19
- name : Lint Code Base
20
20
uses : github/super-linter@v3
26
26
runs-on : ubuntu-latest
27
27
outputs :
28
28
tag : ${{ steps.info.outputs.tag }}
29
+ repo : ${{ steps.info.outputs.repo }}
29
30
steps :
30
- - name : Checkout Code
31
+ # Preparation
32
+ - name : Checkout Code (Testing)
31
33
uses : actions/checkout@v2
34
+ - name : Set up QEMU (Testing)
35
+ uses : docker/setup-qemu-action@v1
36
+ - name : Login to DockerHub (Testing)
37
+ uses : docker/login-action@v1
38
+ with :
39
+ username : ${{ secrets.DOCKER_USERNAME }}
40
+ password : ${{ secrets.DOCKER_PASSWORD }}
41
+ # Test
42
+ - name : Test help command
43
+ uses : ./
44
+ with :
45
+ login : false
46
+ json : false
47
+ task : help
48
+ # Info gathering
32
49
- id : info
33
50
run : |
34
51
repo=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
@@ -44,72 +61,61 @@ jobs:
44
61
tag=$tag
45
62
echo "::set-output name=repo::$repo"
46
63
echo "::set-output name=tag::$tag"
47
- - name : Build and Push to GitHub registry Commit tag
48
- uses : elgohr/Publish-Docker-Github-Action@master
49
- with :
50
- name : docker.pkg.github.com/${{ github.repository }}/jelastic-cli
51
- username : ${{ github.repository_owner }}
52
- password : ${{ secrets.G_TOKEN }}
53
- registry : docker.pkg.github.com
54
- tags : " ${{ steps.info.outputs.tag }}"
55
- - name : Login to GitHub Packages Docker Registry
56
- uses : docker/login-action@v1
64
+ # Build
65
+ - name : Build and Push image (Testing)
66
+ uses : docker/build-push-action@v2
57
67
with :
58
- registry : docker.pkg.github.com
59
- username : ${{ github.repository_owner }}
60
- password : ${{ secrets.G_TOKEN }}
61
- - name : Anchore scan
62
- uses : anchore/scan-action@v2
63
- with :
64
- image : " docker.pkg.github.com/${{ steps.info.outputs.repo }}/jelastic-cli:${{ steps.info.outputs.tag }}"
65
- fail-build : true
66
- acs-report-enable : true
67
- severity-cutoff : high
68
- - name : upload Anchore scan SARIF report
69
- uses : github/codeql-action/upload-sarif@v1
70
- with :
71
- sarif_file : results.sarif
68
+ push : true
69
+ tags : aliaksandrdounar/jelastic-cli:latest
72
70
73
- docker :
71
+ build :
74
72
name : Build and Public Docker image
75
73
runs-on : ubuntu-latest
76
74
needs : [lint, test]
77
75
steps :
78
- - name : Checkout Code
76
+ # Prepare
77
+ - name : Checkout Code (Build)
79
78
uses : actions/checkout@v2
79
+ - name : Set up QEMU (Build)
80
+ uses : docker/setup-qemu-action@v1
81
+ - name : Login to docker.pkg.github.com (Build)
82
+ uses : docker/login-action@v1
83
+ with :
84
+ registry : docker.pkg.github.com
85
+ username : ${{ github.repository_owner }}
86
+ password : ${{ secrets.G_TOKEN }}
87
+ - name : Login to DockerHub
88
+ uses : docker/login-action@v1
89
+ with :
90
+ username : ${{ secrets.DOCKER_USERNAME }}
91
+ password : ${{ secrets.DOCKER_PASSWORD }}
80
92
- name : Dry-run tag generation
81
93
id : create_tag_test
82
94
uses :
anothrNick/[email protected]
83
95
env :
84
96
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
85
97
WITH_V : true
86
98
DRY_RUN : true
87
- - name : Build and Push to GitHub registry
88
- uses : elgohr/Publish-Docker-Github-Action@master
89
- with :
90
- name : docker.pkg.github.com/${{ github.repository }}/jelastic-cli
91
- username : ${{ github.repository_owner }}
92
- password : ${{ secrets.G_TOKEN }}
93
- registry : docker.pkg.github.com
94
- tags : " ${{ needs.test.outputs.tag }},${{ steps.create_tag_test.outputs.new_tag }},latest"
95
- - name : Build and Push to DockerHub
96
- uses : elgohr/Publish-Docker-Github-Action@master
99
+ # Build
100
+ - name : Build and Push image
101
+ uses : docker/build-push-action@v2
97
102
with :
98
- name : aliaksandrdounar/jelastic-cli
99
- username : ${{ secrets.DOCKER_USERNAME }}
100
- password : ${{ secrets.DOCKER_PASSWORD }}
101
- tags : " ${{ needs.test.outputs.tag }},${{ steps.create_tag_test.outputs.new_tag }},latest"
102
-
103
+ push : true
104
+ tags : >
105
+ docker.pkg.github.com/${{ needs.test.outputs.repo }}/jelastic-cli:${{ needs.test.outputs.tag }},
106
+ docker.pkg.github.com/${{ needs.test.outputs.repo }}/jelastic-cli:${{ steps.create_tag_test.outputs.new_tag }},
107
+ docker.pkg.github.com/${{ needs.test.outputs.repo }}/jelastic-cli:latest,
108
+ aliaksandrdounar/jelastic-cli:${{ needs.test.outputs.tag }},
109
+ aliaksandrdounar/jelastic-cli:${{ steps.create_tag_test.outputs.new_tag }},
110
+ aliaksandrdounar/jelastic-cli:latest
103
111
release :
104
112
name : Create Release
105
113
runs-on : ubuntu-latest
106
114
if : github.event_name == 'push' && github.ref == 'refs/heads/master'
107
- needs : docker
115
+ needs : build
108
116
steps :
109
- - name : Checkout code
117
+ - name : Checkout Code (Release)
110
118
uses : actions/checkout@v2
111
- with :
112
- fetch-depth : 0
113
119
- name : Changelog generation
114
120
uses :
heinrichreimer/[email protected]
115
121
id : changelog
0 commit comments