Skip to content

init: add build dockerfile #10

init: add build dockerfile

init: add build dockerfile #10

Workflow file for this run

name: ci
on:
workflow_dispatch:
push:
branches:
- 'master'
jobs:
build:
runs-on: ubuntu-latest
env:
ubuntu: mantic # noble
image_name: ghcr.io/revyos
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
arch_name: amd64
- platform: linux/riscv64
arch_name: riscv64
steps:
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
build_date=$(date "+%Y.%m.%d")
echo "BUILD_DATE=${build_date}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Download Rootfs
run: |
wget https://cloud-images.ubuntu.com/${ubuntu}/current/${ubuntu}-server-cloudimg-${{ matrix.arch_name }}-root.tar.xz
mv ${ubuntu}-server-cloudimg-${{ matrix.arch_name }}-root.tar.xz ${{ matrix.arch_name }}.tar.xz
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.image_name }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: build
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: ${{ matrix.platform }}
build-args: |
arch_name=${{ matrix.arch_name }}
tags: |
${{ env.image_name }}/revyos-kernel-builder:${{ matrix.arch_name }}-${{ env.BUILD_DATE }}