-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.2 KB
/
buildah.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build dnsmasq oci container image
on:
workflow_dispatch:
inputs:
custom_tag:
description: optional custom tag on remote repo you want image to be tagged with
required: false
default: 'latest'
type: string
env:
# Use docker.io for Docker Hub if empty
REGISTRY: quay.io
IMAGE_NAME: 3scale/dnsmasq
jobs:
buildah:
runs-on: ubuntu-latest
steps:
- name: Log in to Red Hat Registry
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USER_NAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=branch,enable=${{ github.ref_name != 'main' && inputs.custom_tag == '' }}
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
type=raw,value=nightly,enable=${{ github.ref_name == 'main' }}
${{ inputs.custom_tag }}
type=ref,event=tag
type=ref,event=pr
- uses: actions/checkout@v4
- name: Build image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
layers: false
oci: true
tls-verify: true
extra-args: |
--squash
containerfiles: |
Containerfile
- name: Echo Outputs
run: |
echo "Image: ${{ steps.build-image.outputs.image }}"
echo "Tags: ${{ steps.build-image.outputs.tags }}"
echo "Tagged Image: ${{ steps.build-image.outputs.image-with-tag }}"
- name: Check images created
run: buildah images
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
if: github.event_name != 'pull_request'
with:
tags: ${{ steps.build-image.outputs.tags }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"