-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.77 KB
/
Copy pathbuild.yaml
File metadata and controls
52 lines (46 loc) · 1.77 KB
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
name: Build container image
on:
pull_request:
push:
branches:
- main
tags:
- '*'
jobs:
build:
name: Build container image
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v3
with:
image: ${{ github.event.repository.name }}
tags: ${{ github.event_name == 'pull_request' && github.sha || (github.ref_name == 'main' && 'latest' || github.ref_name) }}
archs: amd64, arm64, ppc64le, riscv64, s390x
containerfiles: |
./Dockerfile
- name: Test container image
run: |
podman run -d --name webdav-test -p 8080:8080 localhost/${{ steps.build_image.outputs.image }}:${{ steps.build_image.outputs.tags }}
for i in $(seq 1 10); do curl -sf http://localhost:8080/ > /dev/null && break || sleep 1; done
curl -sf -T /etc/hostname http://localhost:8080/testfile
curl -sf http://localhost:8080/testfile -o /tmp/downloaded
diff /etc/hostname /tmp/downloaded
podman rm -f webdav-test
- name: Push To Registry
if: github.event_name == 'push' && (github.ref_type == 'tag' || github.ref_name == 'main')
uses: redhat-actions/push-to-registry@v3
id: push_image
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ vars.IMAGE_REGISTRY }}/${{ vars.IMAGE_NAMESPACE }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}