forked from axoflow/axosyslog
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (82 loc) · 2.46 KB
/
dbld-images.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Compile dbld-images
permissions: write-all
on:
pull_request:
paths:
- 'dbld/**'
- 'packaging/rhel/**'
- 'packaging/debian/**'
- '.github/workflows/dbld-images.yml'
push:
paths:
- 'dbld/**'
- 'packaging/rhel/**'
- 'packaging/debian/**'
- '.github/workflows/dbld-images.yml'
schedule:
- cron: '00 22 * * *'
workflow_dispatch:
inputs:
testing_image_upload:
description: Should we upload the images into GitHub Packages? (true/false)
required: false
default: "false"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- almalinux-9
- almalinux-8
- fedora-39
- fedora-40
- debian-bullseye
- debian-bookworm
- debian-sid
- debian-testing
- ubuntu-focal
- ubuntu-jammy
- ubuntu-noble
- ubuntu-lunar
- ubuntu-mantic
- devshell
- tarball
fail-fast: false
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Set container registry
run: |
CONTAINER_REGISTRY="ghcr.io/${{ github.repository_owner }}"
CONTAINER_REGISTRY="$(echo "$CONTAINER_REGISTRY" | tr '[:upper:]' '[:lower:]')"
. .github/workflows/gh-tools.sh
gh_export CONTAINER_REGISTRY
- name: Build the images
run: dbld/rules image-${{ matrix.image }}
- name: Should we upload the images?
run: |
if [ "${{ github.event.inputs.testing_image_upload }}" = "true" ] || \
( \
[ "${{ github.repository_owner }}" = "axoflow" ] && \
[ "${{ github.ref }}" = "refs/heads/main" ] && \
[[ "${{ github.event_name }}" =~ ^(push|workflow_dispatch|schedule)$ ]] \
)
then
UPLOAD_IMAGES_INTERNAL="true"
else
UPLOAD_IMAGES_INTERNAL="false"
fi
. .github/workflows/gh-tools.sh
gh_export UPLOAD_IMAGES_INTERNAL
- name: Log in to the Container registry
if: env.UPLOAD_IMAGES_INTERNAL == 'true'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push the images
if: env.UPLOAD_IMAGES_INTERNAL == 'true'
run: |
dbld/rules push-image-${{ matrix.image }}