-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (77 loc) · 2.71 KB
/
image.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
name: Build and push OCI image
on:
schedule:
- cron: '7 7 * * *' # UTC
push:
branches:
- main
workflow_dispatch:
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -e SC3037 -e SC3057 -e SC3060
- name: Max. 79 characters per line
run: |
wc -L *.sh | sort -nr
MLL=$(gawk '{ if(length > L) { L=length } } END { print L }' *.sh)
(( ${MLL:-80} <= 79 )) || exit 1
build:
needs: shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create image metadata
id: meta
run: echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Quay Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/riscv64,linux/s390x
push: ${{ github.event_name != 'pull_request' }}
tags: |
smblds/smblds:latest
quay.io/smblds/smblds:latest
labels: |
org.opencontainers.image.created=${{ steps.meta.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
org.label-schema.build-date=${{ steps.meta.outputs.created }}
org.label-schema.vcs-ref=${{ github.sha }}
provenance: false
check:
needs: build
runs-on: ubuntu-latest
container: smblds/smblds:latest
steps:
- name: Run ENTRYPOINT explicitly
run: /entrypoint.sh /bin/sh
- name: Run ldbsearch against Samba
run: ldbsearch -H /var/lib/samba/private/sam.ldb > /dev/null
- name: Wait for started Samba services
run: for cnt in $(seq 1 9); do netstat -lnpt | grep :389 && netstat -lnpt | grep :636 && break || sleep 1; done
- name: Run ldapsearch against Samba
run: ldapsearch -v > /dev/null