Image Build CI #23
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 CI | |
on: | |
workflow_dispatch: {} | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
filename: build-${{ github.run_number }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
run: | | |
docker build \ | |
--build-arg APT_SOURCE=http://deb.debian.org \ | |
-t labstrap . | |
- name: Get base image | |
run: | | |
wget --progress=dot:giga \ | |
-O ~/input.tar.zst \ | |
https://mirrors.ustc.edu.cn/proxmox/images/system/debian-12-standard_12.2-1_amd64.tar.zst | |
- name: Build it! | |
run: | | |
docker run --rm -i --name=labstrap --privileged \ | |
-e GITHUB_RUN_NUMBER \ | |
-v "$PWD":/srv:ro \ | |
-v $HOME/rootfs:/target \ | |
-v $HOME/input.tar.zst:/input.tar.zst:ro \ | |
labstrap | |
- name: Pack it! | |
run: | | |
. ./variables | |
sudo tar caf ${{ env.filename }}.tar.zst -C $HOME/rootfs $TAR_FLAGS . | |
sha256sum ${{ env.filename }}.tar.zst > ${{ env.filename }}-sha256.txt | |
- name: Upload it! | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: auto-build-debian12 | |
target_commitish: debian12 | |
files: | | |
${{ env.filename }}.tar.zst | |
${{ env.filename }}-sha256.txt |