-
Notifications
You must be signed in to change notification settings - Fork 25
54 lines (46 loc) · 1.38 KB
/
build-and-push-cronjob-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
51
52
53
54
name: Build & push cron-job images
on:
workflow_dispatch:
push:
branches:
- main
paths:
- cron-jobs/import-images/**
- cron-jobs/packit-service-validation/**
jobs:
build-and-push:
# To not run in forks
if: github.repository_owner == 'packit'
name: Build and push image
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: import-images
- image: packit-service-validation
env:
path: cron-jobs/${{ matrix.image }}/
steps:
- uses: actions/checkout@v3
- name: Add short SHA to the list of tags
shell: bash
run: |
echo "tags=latest ${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
id: calculate-tags
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: ${{ env.path }}Containerfile
image: ${{ matrix.image }}
context: ${{ env.path }}
oci: true
tags: ${{ steps.calculate-tags.outputs.tags }}
- name: Push To Quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/packit
username: ${{ secrets.QUAY_IMAGE_BUILDER_USERNAME }}
password: ${{ secrets.QUAY_IMAGE_BUILDER_TOKEN }}