|
| 1 | +# |
| 2 | +# Copyright (C) 2024 Red Hat, Inc. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# |
| 16 | +# SPDX-License-Identifier: Apache-2.0 |
| 17 | + |
| 18 | +name: build-builder |
| 19 | + |
| 20 | +on: |
| 21 | + push: |
| 22 | + branches: |
| 23 | + - main |
| 24 | + |
| 25 | +jobs: |
| 26 | + build-and-push-image: |
| 27 | + runs-on: ubuntu-24.04 |
| 28 | + permissions: |
| 29 | + contents: read |
| 30 | + packages: write |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Checkout repository |
| 34 | + uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 |
| 35 | + |
| 36 | + - name: Build Image |
| 37 | + id: build-image |
| 38 | + uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 #v2.17 |
| 39 | + with: |
| 40 | + image: ghcr.io/${{ github.repository }}-builder |
| 41 | + tags: latest ${{ github.sha }} |
| 42 | + containerfiles: | |
| 43 | + ./oci/Containerfile.builder |
| 44 | +
|
| 45 | + - name: Push To Registry |
| 46 | + uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c #v2.8 |
| 47 | + with: |
| 48 | + image: ${{ steps.build-image.outputs.image }} |
| 49 | + tags: ${{ steps.build-image.outputs.tags }} |
| 50 | + registry: ghcr.io |
| 51 | + username: ${{ github.actor }} |
| 52 | + password: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments