-
Notifications
You must be signed in to change notification settings - Fork 270
66 lines (59 loc) · 2.27 KB
/
ubi8-asciidoctor-publish.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: ubi8-asciidoctor-publish
on:
schedule:
- cron: '0 1 * * *' # everyday at 1am
push:
paths:
- utilities/ubi8-asciidoctor/version.json
- .github/workflows/ubi8-asciidoctor-publish.yaml
# Declare default permissions as read only.
permissions: read-all
jobs:
build:
env:
context: utilities/ubi8-asciidoctor
image_name: ubi8-asciidoctor
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Get image tags
id: image_tags
uses: redhat-cop/github-actions/get-image-version@1a584131f8a335296e866d1fb0988870ca83aefb # v4
with:
IMAGE_CONTEXT_DIR: ${{ env.context }}
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build image
id: build_image
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2
with:
context: ${{ env.context }}
dockerfiles: |
./${{ env.context }}/Dockerfile
image: ${{ env.image_name }}
platforms: linux/amd64,linux/arm64
tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}"
- name: Push to ghcr.io
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
if: ${{ !contains(github.ref, 'renovate') }}
with:
image: ${{ steps.build_image.outputs.image }}
registry: ghcr.io/${{ github.repository }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
tags: ${{ steps.build_image.outputs.tags }}
- name: Push to Quay
env:
REGISTRY_URI: ${{ secrets.REGISTRY_URI }}
if: ${{ env.REGISTRY_URI != '' && !contains(github.ref, 'renovate') }}
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2
with:
image: ${{ steps.build_image.outputs.image }}
registry: ${{ secrets.REGISTRY_URI }}/${{ secrets.REGISTRY_REPOSITORY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
tags: ${{ steps.build_image.outputs.tags }}