-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
54 lines (49 loc) · 1.36 KB
/
action.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
45
46
47
48
49
50
51
52
53
54
name: '@actalog/dockerfile-ci'
description: CI pipeline for Dockerfile
author: Gabriel Rufino <[email protected]>
branding:
icon: refresh-ccw
color: blue
inputs:
image-name:
required: false
default: image
image-version:
required: false
default: '1.0.0'
runs:
using: 'composite'
steps:
- uses: hadolint/[email protected]
- run: |
docker image build \
-t ${{ inputs.image-name }}:latest \
-t ${{ inputs.image-name }}:${{ inputs.image-version }} \
.
shell: bash
- run: |
docker image save \
-o images.tar \
${{ inputs.image-name }}:latest
shell: bash
- uses: actions/upload-artifact@v4
with:
name: dockerfile-ci
path: |
images.tar
- if: ${{ github.event_name == 'pull_request' }}
id: info
run: |
size=$(docker images ${{ inputs.image-name }}:latest --format "{{.Size}}")
echo "size=$size" >> $GITHUB_OUTPUT
shell: bash
- if: ${{ github.event_name == 'pull_request' }}
uses: peter-evans/create-or-update-comment@v4
continue-on-error: true
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
# Dockerfile CI
Dockerfile CI completed!
## Statistics
* **image size:** ${{ steps.info.outputs.size }}