-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (34 loc) · 1.5 KB
/
periodic.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
name: Periodic Build and Push
on:
push:
branches: [ main ]
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE: ghcr.io/${{ github.actor }}/fedora-qemu-user-static
SOURCE: https://github.com/${{ github.actor }}/fedora-qemu-user-static
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get -y install podman buildah
- uses: redhat-actions/[email protected]
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
- run: sudo podman run --net=host --rm --privileged ${{ env.IMAGE }} register
# - uses: redhat-actions/buildah-build@v2
# with:
# containerfiles: Dockerfile
# context: .
# image: localhost/nonce
# extra-args: --all-platforms --manifest localhost/doge-image
- run: buildah version
- run: echo FEDORARELEASE=`curl -q https://endoflife.date/api/fedora.json | jq -r '.[0].latest'` | tee -a ${GITHUB_ENV}
- run: buildah build --build-arg FEDORARELEASE=${FEDORARELEASE:-latest} --build-arg IMAGE=${{ env.IMAGE }} --build-arg SOURCE=${{ env.SOURCE }} --platform linux/arm64,linux/amd64,linux/ppc64le,linux/s390x --manifest ${{ env.IMAGE }} --net=host .
- run: buildah manifest push --format v2s2 --all ${{ env.IMAGE }} docker://${{ env.IMAGE }}:$(TZ=UTC date +%Y-%m-%d)
- run: buildah manifest push --format v2s2 --all ${{ env.IMAGE }} docker://${{ env.IMAGE }}