Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 54 additions & 25 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

# Run at 01:42 UTC every Saturday
schedule:
- cron: '42 1 * * 6'
- cron: "42 1 * * 6"

jobs:
build-test-deploy:
Expand All @@ -20,24 +20,25 @@ jobs:
strategy:
fail-fast: false
matrix:
base_distro: [
alma-8,
alma-9,
centos-7,
debian-10,
debian-11,
debian-12,
fedora-36,
fedora-37,
fedora-38,
fedora-39,
fedora-40,
opensuse-15.4,
opensuse-15.5,
ubuntu-18.04,
ubuntu-20.04,
ubuntu-22.04
]
base_distro:
[
alma-8,
alma-9,
centos-7,
debian-10,
debian-11,
debian-12,
fedora-36,
fedora-37,
fedora-38,
fedora-39,
fedora-40,
opensuse-15.4,
opensuse-15.5,
ubuntu-18.04,
ubuntu-20.04,
ubuntu-22.04,
]
env:
BASE_DISTRO: ${{ matrix.base_distro }}
REPO: crops/poky
Expand All @@ -50,10 +51,38 @@ jobs:
steps:
- uses: actions/checkout@v4

# Build and test the images
- name: Run build-and-test.sh
run: ./build-and-test.sh
- name: Generate tag
id: tag
run: echo "TAG=${{github.env.REPO}}:${{ matrix.base_distro }}" >> $GITHUB_OUTPUT

# Deploy the images
- name: Deploy
run: bash deploy.sh
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.env.GHCR_USERNAME }}
password: ${{ github.env.GHCR_PASSWORD }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
load: true
pull: true
build-args: |
BASE_DISTRO=${{ matrix.base_distro }}
tags: ${{ steps.tag.outputs.TAG }}

- name: Test
run: ./tests/test.sh ${{ steps.tag.outputs.TAG }}

- name: Push image to GHCR
run: |
docker buildx imagetools create \
--tag ghcr.io/${{ steps.tag.outputs.TAG }} \
${{ steps.tag.outputs.TAG }}