-
Notifications
You must be signed in to change notification settings - Fork 57
55 lines (50 loc) · 1.84 KB
/
main.yaml
File metadata and controls
55 lines (50 loc) · 1.84 KB
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
name: Create container image on main
# This workflow builds a container image for each commit on the main branch.
# The image is tagged with the (short) commit ID, "main" and "0.1.0" (i.e. the
# development release), and pushed to Quay.
on:
push:
branches:
- main
env:
DEV_RELEASE: 0.1.0
CONTAINER_REGISTRY: quay.io/redhat-certification
jobs:
image:
name: Build and push container images
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Get commit ID
id: get_commit_id
run: |
# Make the short commit ID available to the following steps.
COMMIT_ID="$(git rev-parse --short HEAD)"
echo "commit_id=$COMMIT_ID" | tee -a "${GITHUB_OUTPUT}"
- name: Build container images
id: build_container_images
env:
COMMIT_ID: ${{ steps.get_commit_id.outputs.commit_id }}
run: |
podman version
# Build podman images locally
make build-image "IMAGE_TAG=${COMMIT_ID}" QUAY_EXPIRE_AFTER=1w
make build-image IMAGE_TAG=main
podman tag "${CONTAINER_REGISTRY}/chart-verifier:main" "${CONTAINER_REGISTRY}/chart-verifier:${DEV_RELEASE}"
- name: Push to quay.io
id: push_to_quay
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8
with:
image: chart-verifier
tags: |
${{ steps.get_commit_id.outputs.commit_id }}
main
${{ env.DEV_RELEASE }}
registry: quay.io/redhat-certification
username: ${{ secrets.QUAY_BOT_USERNAME }}
password: ${{ secrets.QUAY_BOT_TOKEN }}