-
Notifications
You must be signed in to change notification settings - Fork 56
49 lines (42 loc) · 1.22 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
name: Build containers
on:
pull_request:
branches: [main]
paths-ignore:
- "README.md"
workflow_dispatch:
schedule:
- cron: '35 4 * * *'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Build image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: "latest"
containerfiles: Containerfile
archs: amd64, arm64
- name: Log in to the Container registry
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub Container Repository
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: "latest"
registry: ${{ env.REGISTRY }}