-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
66 lines (66 loc) · 2.13 KB
/
action.yaml
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
name: 'Build exporter'
description: 'Build and release an exporter'
inputs:
exporter:
description: 'Exporter name'
required: true
default: ''
artifactory_token:
description: 'Artifactory token'
required: true
default: ''
artifactory_username:
description: 'Artifactory username'
required: true
default: ''
tag_name:
description: 'Tag name'
required: true
default: ''
target:
description: 'Target name'
required: false
default: ''
sysdig_secure_token:
description: 'Sysdig Secure token'
required: true
default: ''
dockerfile:
description: 'Dockerfile destination'
required: false
default: 'Dockerfile'
repository:
description: 'Repository url'
required: true
default: ''
branding:
color: 'green'
runs:
using: "composite"
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- name: Login to Artifactory
uses: docker/login-action@v1
with:
registry: ${{ inputs.repository }}
username: ${{ inputs.artifactory_username }}
password: ${{ inputs.artifactory_token }}
- name: Build image
shell: bash
run: |
docker build --label release=${{ inputs.tag_name }} -f ${{ inputs.dockerfile }} --target ${{ inputs.target }} -t ${{ inputs.repository }}/${{ inputs.exporter }}:latest .
- name: Publish docker image
if: ${{ inputs.target }} == 'ubi'
shell: bash
run: |
docker tag ${{ inputs.repository }}/${{ inputs.exporter }}:latest ${{ inputs.repository }}/${{ inputs.exporter }}:${{ inputs.tag_name }}-${{ inputs.target }}
docker push ${{ inputs.repository }}/${{ inputs.exporter }}:${{ inputs.tag_name }}-${{ inputs.target }}
docker push ${{ inputs.repository }}/${{ inputs.exporter }}:latest
- name: Publish docker image
if: ${{ inputs.target }} != 'ubi'
shell: bash
run: |
docker tag ${{ inputs.repository }}/${{ inputs.exporter }}:latest ${{ inputs.repository }}/${{ inputs.exporter }}:${{ inputs.tag_name }}
docker push ${{ inputs.repository }}/${{ inputs.exporter }}:${{ inputs.tag_name }}