-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (40 loc) · 1.18 KB
/
build-and-push-image.yaml
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
name: Build & push the validation image
on:
workflow_dispatch:
push:
branches:
- main
paths:
- src/**
- Containerfile
jobs:
build-and-push:
# To not run in forks
if: github.repository_owner == 'packit'
name: Build and push image
runs-on: ubuntu-latest
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: Containerfile
image: packit-service-validation
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 }}