parch-iso-template/.forgejo/workflows/build.yaml
Sohrab Behdani fd5fba6be5
Some checks failed
Build and Deploy ISO / build_iso (release) Failing after 27m22s
ReTry
2025-02-13 19:10:01 +03:30

46 lines
1.5 KiB
YAML

name: Build and Deploy ISO
on:
release:
types: [published]
jobs:
build_iso:
runs-on: ubuntu-latest
container:
image: archlinux/archlinux:base-devel
privileged: true
env:
Desktop: "template"
steps:
- name: Install Node.js
run: pacman -Sy --noconfirm nodejs npm git sudo
- name: Checkout code
uses: actions/checkout@v4
- name: update
run: pacman -Syyuu --noconfirm
- name: whoami
run: whoami
- name: Build ISO
run: |
sudo ./build.sh
echo "Renaming the output ISO file"
mv out/*.iso out/ParchLinux-${{ env.Desktop }}-latest.iso
echo "Generating MD5 checksum"
md5sum out/ParchLinux-${{ env.Desktop }}-latest.iso > out/md5sum.txt
echo "Build completed. Files generated:"
ls -lh out/
- name: Setup dependencies
run: pacman -Syu --noconfirm sshpass rsync
- name: Determine remote directory
run: |
if [[ "${{ github.event.release.tag_name }}" == *"beta"* ]]; then
echo "REMOTE_DIR=/srv/http/beta/${{ env.Desktop }}/" >> $GITHUB_ENV
else
echo "REMOTE_DIR=/srv/http/${{ env.Desktop }}/" >> $GITHUB_ENV
fi
- name: Deploy files
run: |
sshpass -e ssh -o StrictHostKeyChecking=no parch@${{ env.SSHHOST }} "rm -rf ${{ env.REMOTE_DIR }} && mkdir -p ${{ env.REMOTE_DIR }}"
sshpass -e rsync -avz out/ParchLinux-${{ env.Desktop }}-latest.iso out/md5sum.txt parch@${{ env.SSHHOST }}:${{ env.REMOTE_DIR }}