forked from Netcracker/qubership-integration-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (96 loc) · 2.98 KB
/
dev-mvn-docker-build.yml
File metadata and controls
104 lines (96 loc) · 2.98 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Dev Mvn Docker Build
run-name: "Dev build repository: ${{ github.ref_name }} #${{ github.run_number }}"
on:
workflow_dispatch:
inputs:
maven-command:
description: 'Maven command'
required: false
type: string
default: "--batch-mode package -Dgpg.skip=true"
custom-image-name:
description: 'Custom image name'
required: false
default: ''
tags:
description: 'Tags'
required: false
type: string
default: ''
java-version:
description: 'Java version (e.g., 21)'
required: false
type: string
default: "21"
dry-run:
description: 'Dry run'
required: false
type: boolean
default: false
push:
branches:
- '**'
paths-ignore:
- 'docs/**'
- 'CODE-OF-CONDUCT.md'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
- 'SECURITY.md'
pull_request:
branches:
- '**'
paths-ignore:
- '.github/**'
- 'docs/**'
- 'CODE-OF-CONDUCT.md'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'
- 'SECURITY.md'
permissions:
contents: read
jobs:
dev-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Maven build artifact
uses: netcracker/qubership-workflow-hub/actions/maven-snapshot-deploy@9319676b7d20b423a2e0943a0ac08da07d615998 #v1.0.6
with:
maven-command: "${{ github.event.inputs.maven-command || '--batch-mode clean install -Dgpg.skip=true' }}"
java-version: ${{ github.event.inputs.java-version || '21' }}
- name: Create name
uses: netcracker/qubership-workflow-hub/actions/metadata-action@main
id: metadata
- name: Prepare tags
id: prepare_tags
run: |
BASE_TAG="${{ steps.metadata.outputs.result }}"
EXTRA_TAG="${{ github.event.inputs.tags }}"
if [ -n "$EXTRA_TAG" ]; then
TAGS="${BASE_TAG}, ${EXTRA_TAG}"
else
TAGS="${BASE_TAG}"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Summary step
run: |
echo "**Metadata:** ${{ steps.metadata.outputs.result }}" >> $GITHUB_STEP_SUMMARY
echo "**Tags:** ${{ steps.prepare_tags.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
- name: Build and Publish Docker Image
uses: netcracker/qubership-workflow-hub/actions/docker-action@9319676b7d20b423a2e0943a0ac08da07d615998 #v1.0.6
with:
custom-image-name: ${{ github.event.inputs.custom-image-name || '' }}
platforms: ${{ env.PLATFORMS }}
checkout: "false"
tags: ${{ steps.prepare_tags.outputs.tags }}
dry-run: ${{ github.event.inputs.dry-run || 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}