|
6 | 6 | workflow_dispatch: |
7 | 7 | schedule: |
8 | 8 | # Run the workflow on the 1st of every month at midnight |
9 | | - - cron: 0 0 * * * |
| 9 | + - cron: '0 0 1 * *' |
10 | 10 |
|
11 | 11 | jobs: |
12 | 12 | build: |
13 | | - runs-on: ubuntu-latest # Use a standard runner |
| 13 | + runs-on: ubuntu-latest |
| 14 | + timeout-minutes: 120 # Add a timeout to prevent hung builds |
14 | 15 |
|
15 | 16 | steps: |
16 | 17 | - name: Checkout Repository |
17 | 18 | uses: actions/checkout@v4 |
18 | 19 |
|
19 | | - - name: Build and Run Docker container |
| 20 | + - name: Set up Environment |
20 | 21 | run: | |
21 | | - set -e # Exit immediately if a command exits with a non-zero status |
22 | | - docker build -t arch-iso-builder . || { echo "Docker build failed"; exit 1; } |
23 | | - docker run --rm --privileged -v "$(pwd)":/workdir arch-iso-builder bash -c "mkarchiso -v -w workdir/ -o out/ ." || { echo "ISO creation failed"; exit 1; } |
| 22 | + echo "Setting up environment..." |
| 23 | + mkdir -p out |
| 24 | + chmod +x scripts/entrypoint.sh |
| 25 | + chmod +x scripts/select-mirrors.sh |
| 26 | + chmod +x profiledef.sh |
| 27 | +
|
| 28 | + - name: Build Docker Image |
| 29 | + run: | |
| 30 | + echo "Building Docker image..." |
| 31 | + docker build -t arch-iso-builder . || { |
| 32 | + echo "::error::Docker build failed" |
| 33 | + exit 1 |
| 34 | + } |
| 35 | +
|
| 36 | + - name: Validate Configuration |
| 37 | + run: | |
| 38 | + echo "Validating configuration..." |
| 39 | + docker run --rm -v "$(pwd)":/workdir arch-iso-builder validate || { |
| 40 | + echo "::error::Configuration validation failed" |
| 41 | + exit 1 |
| 42 | + } |
| 43 | +
|
| 44 | + - name: Build ISO |
| 45 | + run: | |
| 46 | + echo "Building ISO..." |
| 47 | + # Create a small-scale test build with output to verify the process works |
| 48 | + docker run --rm --privileged \ |
| 49 | + -v "$(pwd)":/workdir \ |
| 50 | + arch-iso-builder build out work || { |
| 51 | + echo "::error::ISO build failed" |
| 52 | + exit 1 |
| 53 | + } |
| 54 | + |
| 55 | + # Verify that output directory contains files |
| 56 | + if [ ! -d "out" ] || [ -z "$(ls -A out 2>/dev/null)" ]; then |
| 57 | + echo "::error::Output directory is empty or does not exist" |
| 58 | + exit 1 |
| 59 | + else |
| 60 | + echo "ISO build process completed successfully!" |
| 61 | + ls -la out |
| 62 | + fi |
0 commit comments