-
Notifications
You must be signed in to change notification settings - Fork 19
50 lines (42 loc) · 1.2 KB
/
build-renovate-image.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
name: Build renovate image
on:
push:
branches:
- main
paths:
- renovate/Dockerfile
pull_request:
branches:
- main
paths:
- renovate/Dockerfile
env:
REGISTRY: quay.io/redhat-appstudio
IMAGE_NAME: renovate
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version from Dockerfile
id: extract-version
run: echo "version=$(grep -oP '(?<=ARG version=)[^"]*' renovate/Dockerfile)" >> $GITHUB_OUTPUT
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: v${{ steps.extract-version.outputs.version }}
context: ./renovate
containerfiles: |
./renovate/Dockerfile
- name: Push to Quay
if: github.event_name == 'push' # don't push image from PR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}