forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
47 lines (42 loc) · 1.45 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
name: "Build/Push container"
description: "Build a BCC CI container and push it when not a pull-request."
inputs:
os_distro:
description: "OS Disctribution. Ex: ubuntu"
required: true
os_version:
description: "Version of the OS. Ex: 20.04"
required: true
os_nick:
description: "Nickname of the OS. Ex: focal"
required: true
registry:
description: "Registry where to push images"
default: ghcr.io
password:
description: "Password used to log into the docker registry."
push:
description: "Whether or not to push the build image"
type: boolean
default: false
runs:
using: "composite"
steps:
# Login against registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ inputs.registry }}
if: ${{ inputs.push == 'true' && github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ inputs.password }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: ${{ inputs.push == 'true' && github.event_name != 'pull_request' }}
build-args: |
VERSION=${{ inputs.os_version }}
SHORTNAME=${{ inputs.os_nick }}
file: docker/build/Dockerfile.${{ inputs.os_distro }}
tags: ${{ inputs.registry }}/${{ github.repository }}:${{ inputs.os_distro }}-${{ inputs.os_version }}