-
-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (50 loc) · 1.86 KB
/
container-ognibuild-dep.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 and Publish Ognibuild Dep Server Container Images
"on":
# run it on push to the default repository branch
push:
pull_request:
schedule:
- cron: '0 6 * * *' # Daily 6AM UTC build
jobs:
# define job to build and publish container image
build-and-push-ognibuild-dep-container-image:
name: Build Docker image and push to repositories
# run only when code is compiling and tests are passing
runs-on: ubuntu-latest
# steps to perform in job
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
- name: Determine tags to set (pull_request)
run: |
echo "TAGS=${{ github.sha }}" >> $GITHUB_ENV
if: ${{ github.event_name == 'pull_request' }}
- name: Determine tags to set (push)
run: |
echo "TAGS=${{ github.sha }} ${{ github.ref_name }}" >> $GITHUB_ENV
if: ${{ github.event_name == 'push' }}
- name: Login to Github Packages
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build ognibuild-dep image
id: build-image-ognibuild-dep
uses: redhat-actions/buildah-build@v2
with:
containerfiles: "Dockerfile_ognibuild_dep"
image: ghcr.io/jelmer/janitor/ognibuild_dep
tags: ${{ env.TAGS }}
- name: Push ognibuild-dep image to ghcr.io
if: ${{ github.event_name != 'pull_request' }}
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image-ognibuild-dep.outputs.image }}
tags: ${{ steps.build-image-ognibuild-dep.outputs.tags }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}