forked from MariaDB/buildbot
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (72 loc) · 2.31 KB
/
eco_containers.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
---
name: eco container build
on:
push:
paths:
- .github/workflows/eco_containers.yml
- "eco_build_images/**"
pull_request:
paths:
- .github/workflows/eco_containers.yml
- "eco_build_images/**"
schedule:
- cron: 24 3 * * 0
jobs:
build:
runs-on: ubuntu-latest
name: ${{ matrix.tag }}
strategy:
fail-fast: false
matrix:
include:
- containerfile: wordpress_phpunit_test_runner.Dockerfile
tag: wordpress_phpunit_test_runner
archs: amd64
env:
DEPLOY_IMAGES: false
WORKDIR: eco_build_images
steps:
- uses: actions/checkout@v4
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
- name: Check Dockerfile with hadolint
run: |
docker run -i -v $(pwd)/${{ env.WORKDIR }}:/mnt -w /mnt \
hadolint/hadolint:latest hadolint ${{ matrix.containerfile }}
- name: Build with Buildah
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: bb-ecosystem
tags: ${{ matrix.tag }}
containerfiles: ${{ env.WORKDIR }}/${{ matrix.containerfile }}
context: ${{ env.WORKDIR }}
archs: ${{ matrix.archs }}
oci: true
extra-args: --ulimit nofile=1048576:1048576
- name: Check for registry credentials
if: >
github.ref == 'refs/heads/main' &&
github.repository == 'MariaDB/buildbot'
run: |
missing=()
[[ -n "${{ secrets.QUAY_USER }}" ]] || missing+=(QUAY_USER)
[[ -n "${{ secrets.QUAY_TOKEN }}" ]] || missing+=(QUAY_TOKEN)
for i in "${missing[@]}"; do
echo "Missing github secret: $i"
done
if (( ${#missing[@]} == 0 )); then
echo "DEPLOY_IMAGES=true" >> $GITHUB_ENV
else
echo "Not pushing images to registry"
fi
- name: Push To quay.io
id: push-to-quay
if: ${{ env.DEPLOY_IMAGES == 'true' }}
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/mariadb-foundation
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}