forked from openshift-pipelines/pipeline-service
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.53 KB
/
argocd-registrar-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
---
name: Build and Publish argocd-registrar Image
on:
push:
branches:
- main
paths:
- "exploration/argocd-external/images/argocd-registrar/**"
workflow_dispatch:
jobs:
build-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
steps:
- uses: actions/checkout@v3
- name: Get the short sha
id: vars
run: echo "::set-output name=sha_short::$(echo ${{ github.sha }} | cut -b -7)"
# Build and push an argocd-registrar image, tagged with latest and the commit SHA.
- name: Build argocd-registrar Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: argocd-registrar
context: ./exploration/argocd-external/images/argocd-registrar
tags: latest ${{ steps.vars.outputs.sha_short }} ${{ github.ref_name }}
containerfiles: |
./exploration/argocd-external/images/argocd-registrar/Dockerfile
- name: Push to quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }} ${{ github.ref_name }}
registry: quay.io/redhat-pipeline-service
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"