Image Build #201
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: Image Build | |
on: | |
workflow_dispatch: {} | |
push: {} | |
schedule: | |
# run build every week | |
- cron: '0 0 * * 0' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: ${{ matrix.distro }}:${{ matrix.version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
distro: [fedora, rockylinux] | |
version: [latest] | |
include: | |
- distro: fedora | |
version: 39 | |
- distro: fedora | |
version: 40 | |
- distro: fedora | |
version: 41 | |
- distro: fedora | |
version: 42 | |
- distro: rockylinux | |
version: 8 | |
- distro: rockylinux | |
version: 9 | |
exclude: | |
- distro: rockylinux | |
version: latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build Image | |
env: | |
BASE_IMAGE: docker.io/${{ matrix.distro }}:${{ matrix.version }} | |
TARGET_IMAGE: rpmbuilder:${{ matrix.distro }}-${{ matrix.version }} | |
run: ./bin/build.sh | |
- name: Test Image | |
env: | |
TARGET_IMAGE: rpmbuilder:${{ matrix.distro }}-${{ matrix.version }} | |
run: ./bin/test.sh | |
- name: Publish Image (docker.io) | |
if: github.ref == 'refs/heads/main' | |
env: | |
IMAGE: rpmbuilder:${{ matrix.distro }}-${{ matrix.version }} | |
REGISTRY: docker.io/alectolytic | |
REGISTRY_USER: ${{ secrets.REGISTRY_USER }} | |
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} | |
run: | | |
docker tag ${IMAGE} ${REGISTRY}/${IMAGE} | |
docker login -u "${REGISTRY_USER}" -p "${REGISTRY_TOKEN}" docker.io | |
docker push ${REGISTRY}/${IMAGE} | |
- name: Publish Image (quay.io) | |
if: github.ref == 'refs/heads/main' | |
env: | |
IMAGE: rpmbuilder:${{ matrix.distro }}-${{ matrix.version }} | |
REGISTRY: quay.io/abn | |
REGISTRY_USER: ${{ secrets.QUAY_USER }} | |
REGISTRY_TOKEN: ${{ secrets.QUAY_TOKEN }} | |
run: | | |
docker tag ${IMAGE} ${REGISTRY}/${IMAGE} | |
docker login -u "${REGISTRY_USER}" -p "${REGISTRY_TOKEN}" quay.io | |
docker push ${REGISTRY}/${IMAGE} |