Periodic Build and Push #89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- 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 }} |