Update build-and-deploy.yml #5
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 and Upload ArchISO | |
on: | |
# Triggers the workflow on push or pull request events but only for the "andromeda-reborn" branch | |
push: | |
branches: [ "andromeda-reborn" ] | |
pull_request: | |
branches: [ "andromeda-reborn" ] # Allow manual triggering | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Step 2: Print working directory and list contents | |
- name: Print working directory and list contents | |
run: | | |
echo "Current directory:" | |
pwd | |
echo "Contents:" | |
ls -la | |
# Step 3: Build ArchISO in Docker | |
- name: Build ArchISO in Docker | |
run: | | |
docker run --rm --privileged -v $PWD:/workspace -w /workspace archlinux:latest /bin/bash -c " | |
pacman -Syu --noconfirm && \ | |
pacman -S --noconfirm archiso sudo && \ | |
cd /workspace && \ | |
sudo mkarchiso -v -w eisowork -o /workspace eiso | |
" | |
# Step 4: List built ISO files | |
- name: List built ISO files | |
run: | | |
echo "ISO files created:" | |
ls -la ./isodir | |
# Step 5: Delete existing files on FTP server | |
- name: Delete existing files on FTP | |
run: | | |
echo "Attempting to connect to FTP server and delete files..." | |
lftp -u ${{ secrets.FTP_USERNAME }},${{ secrets.FTP_PASSWORD }} ${{ secrets.FTP_SERVER }} -e " | |
cd /home/frs/project/neolabssoftware; | |
rm -r *; | |
bye; | |
" | |
# Step 6: Upload ISO files to SourceForge | |
- name: Upload ISO files to SourceForge | |
run: | | |
echo "Uploading files to FTP..." | |
for file in isodir/*; do | |
lftp -u ${{ secrets.FTP_USERNAME }},${{ secrets.FTP_PASSWORD }} ${{ secrets.FTP_SERVER }} -e " | |
put $file -o /home/frs/project/neolabssoftware/$(basename $file); | |
bye; | |
" | |
done |