Skip to content

Commit

Permalink
github/workflows: Add slackware image build
Browse files Browse the repository at this point in the history
Signed-off-by: Din Music <[email protected]>
  • Loading branch information
MusicDin committed Apr 2, 2024
1 parent fa64bd0 commit 338d7c7
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/image-slackware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

name: Build Slackware Images

on:
schedule:
# Run at 00:00 UTC daily.
- cron: '0 0 * * *'
workflow_dispatch:
inputs:
publish:
type: boolean
default: false
description: Publish built image

jobs:
slackware:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
release:
- current
variant:
- default
architecture:
- amd64

env:
type: "container"
distro: "${{ github.job }}"
target: "${HOME}/build"

steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/image-setup
with:
ssh-key: ${{ secrets.LXD_IMAGEBUILDER_KEY }}

- name: Build image
run: |
TIMEOUT=3600
YAML="${{ github.workspace }}/images/${{ env.distro }}.yaml"
ARCH="${{ matrix.architecture }}"
TYPE="${{ env.type }}"
IMAGE_ARCH="${ARCH}"
[ "${ARCH}" = "amd64" ] && IMAGE_ARCH="x86_64"
./bin/build-distro "${YAML}" "${ARCH}" "${TYPE}" "${TIMEOUT}" "${{ env.target }}" \
-o image.architecture="${IMAGE_ARCH}" \
-o image.release="${{ matrix.release }}"
- name: Print build artifacts
run: ls -lah "${{ env.target }}"

- name: Test container image
uses: ./.github/actions/image-test
if: contains(env.type, 'container')
with:
type: container
target: ${{ env.target }}
distro: ${{ env.distro }}
release: ${{ matrix.release }}
variant: ${{ matrix.variant }}

- name: Test VM image
uses: ./.github/actions/image-test
if: contains(env.type, 'vm')
with:
type: vm
target: ${{ env.target }}
distro: ${{ env.distro }}
release: ${{ matrix.release }}
variant: ${{ matrix.variant }}

- name: Upload image
uses: ./.github/actions/image-upload
if: inputs.publish == true
with:
target: ${{ env.target }}
image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}"
ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"

0 comments on commit 338d7c7

Please sign in to comment.