Skip to content

Commit 0e8ccf5

Browse files
Optimize Workflows for Github Actions (#5)
1 parent c4998c9 commit 0e8ccf5

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ version: 2
22
updates:
33
# Update for GitHub Actions dependencies
44
- package-ecosystem: "github-actions"
5-
directory: "/" # Root directory where your GitHub Actions workflows are located (usually .github/workflows)
5+
directory: "/" # Root directory for GitHub Actions workflows
66
schedule:
7-
interval: "daily" # Check for updates weekly
8-
day: "monday" # Run every Monday
9-
time: "08:00" # At 8:00 UTC
7+
interval: "daily" # Check for updates daily (previously mentioned as weekly)
8+
time: "08:00" # Run every day at 08:00 UTC, day specification removed as it's redundant
109
labels:
1110
- "github-actions"
1211
assignees:
13-
- "Githubguy132010" # Replace with your GitHub username
12+
- "Githubguy132010" # Replace with your GitHub username

.github/workflows/build-check.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ jobs:
2020

2121
- name: Set up Arch Linux Container
2222
run: |
23-
docker run --privileged --name arch-container -d -v ${{ github.workspace }}:/workdir archlinux:latest sleep infinity
23+
if ! docker run --privileged --name arch-container -d -v ${{ github.workspace }}:/workdir archlinux:latest sleep infinity; then
24+
echo "Failed to start Arch Linux container." && exit 1
25+
fi
2426
25-
- name: Build ISO in Arch Container
27+
- name: Update and Build ISO in Arch Container
2628
run: |
27-
docker exec arch-container bash -c "
28-
pacman -Syu --noconfirm &&
29-
pacman -S --noconfirm git archiso grub &&
30-
cd /workdir &&
31-
mkarchiso -v -w workdir/ -o out/ .
32-
"
29+
if ! docker exec arch-container bash -c "
30+
pacman -Syu --noconfirm &&
31+
pacman -S --noconfirm git archiso grub &&
32+
cd /workdir &&
33+
mkarchiso -v -w workdir/ -o out/ .
34+
"; then
35+
echo "Failed to build ISO." && exit 1
36+
fi

.github/workflows/build.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
2121
- name: Build ISO in Arch Container
2222
run: |
23+
set -e
2324
docker exec arch-container bash -c "
2425
pacman -Syu --noconfirm &&
2526
pacman -S --noconfirm git archiso grub &&
@@ -29,21 +30,19 @@ jobs:
2930
3031
- name: Rename ISO to Arch.iso
3132
run: |
33+
set -e
3234
docker exec arch-container bash -c "
33-
# Find the created ISO (assuming only one .iso file in the output directory)
34-
iso_file=\$(ls /workdir/out/*.iso | head -n 1) &&
35-
mv \$iso_file /workdir/out/Arch.iso
35+
iso_file=\$(ls /workdir/out/*.iso 2>/dev/null | head -n 1) &&
36+
[ -n \"\$iso_file\" ] && mv \$iso_file /workdir/out/Arch.iso || echo 'No ISO file found.'
3637
"
3738
3839
- name: List ISO files
3940
run: |
40-
# List files in the output directory to verify renaming
41-
docker exec arch-container bash -c "ls -l /workdir/out/"
41+
docker exec arch-container bash -c "ls -l /workdir/out/ || echo 'Failed to list files.'"
4242
4343
- name: Copy ISO to Host
4444
run: |
45-
# Copy the renamed ISO to the host
46-
docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/
45+
docker cp arch-container:/workdir/out/Arch.iso ${{ github.workspace }}/ || echo 'Failed to copy ISO to host.'
4746
4847
- name: Get current date
4948
id: date
@@ -76,5 +75,5 @@ jobs:
7675

7776
- name: Clean Up
7877
run: |
79-
docker stop arch-container
80-
docker rm arch-container
78+
docker stop arch-container || echo 'Failed to stop the container.'
79+
docker rm arch-container || echo 'Failed to remove the container.'

.github/workflows/dockerfile-check.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ jobs:
1818
- name: Checkout Repository
1919
uses: actions/checkout@v4
2020

21-
- name: Build Docker container
21+
- name: Build and Run Docker container
2222
run: |
23-
docker build -t arch-iso-builder .
24-
25-
- name: Make ISO in Docker container
26-
run: |
27-
docker run --rm --privileged -v $(pwd):/workdir arch-iso-builder bash -c "mkarchiso -v -w workdir/ -o out/ ."
23+
set -e # Exit immediately if a command exits with a non-zero status
24+
docker build -t arch-iso-builder . || { echo "Docker build failed"; exit 1; }
25+
docker run --rm --privileged -v "$(pwd)":/workdir arch-iso-builder bash -c "mkarchiso -v -w workdir/ -o out/ ." || { echo "ISO creation failed"; exit 1; }

0 commit comments

Comments
 (0)