Enhance workflow: Add disk space expansion and Pacman cache managemen… #10
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: Build SunnyOS with GNOME ISO | |
on: | |
push: | |
branches: | |
- sunnyos_gnome | |
pull_request: | |
branches: | |
- sunnyos_gnome | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: List repository files for debugging | |
run: | | |
ls -R $GITHUB_WORKSPACE | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Increase Available Disk Space | |
run: | | |
mkdir -p /tmp/temp && sudo mount -t tmpfs -o size=10G tmpfs /tmp/temp | |
- name: Restore Pacman cache | |
uses: actions/cache@v3 | |
with: | |
path: /var/cache/pacman/pkg | |
key: pacman-cache-${{ runner.os }}-${{ hashFiles('**/profile') }} | |
restore-keys: | | |
pacman-cache-${{ runner.os }} | |
- name: Build SunnyOS ISO | |
run: | | |
docker run --rm --privileged \ | |
-v "$GITHUB_WORKSPACE:/work" \ | |
-v "/tmp/temp:/tmp" \ | |
archlinux:latest /bin/bash -c " | |
pacman -Sy --noconfirm archiso && | |
mkarchiso -v -w /tmp/work -o /tmp/out /work/profile | |
" | |
- name: Upload ISO artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sunnyos-iso | |
path: /tmp/temp/out/*.iso | |
- name: Save Pacman cache | |
uses: actions/cache@v3 | |
with: | |
path: /var/cache/pacman/pkg | |
key: pacman-cache-${{ runner.os }}-${{ hashFiles('**/profile') }} |