forked from osbuild/bootc-image-builder
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (50 loc) · 1.42 KB
/
build.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
name: Build containers
on:
pull_request:
branches: [main]
push:
branches:
- "main"
# for merge queue
merge_group:
workflow_dispatch:
env:
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Build image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: "latest"
containerfiles: Containerfile
# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.IMAGE_REGISTRY }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Push the image to GHCR (Image Registry)
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
if: github.event_name != 'pull_request'
id: push
with:
registry: "ghcr.io"
image: ${{ env.IMAGE_NAME }}
tags: "latest"
extra-args: |
--disable-content-trust