parch-iso-template/.forgejo/workflows/build.yaml
hikari a7ba10f01f
Some checks failed
Build and Deploy ISO / build_iso (release) Failing after 16m55s
Update .forgejo/workflows/build.yaml
2025-02-16 09:58:10 -05:00

46 lines
1.6 KiB
YAML

name: Build and Deploy ISO
on:
release:
types: [published]
jobs:
build_iso:
runs-on: ubuntu-latest
container:
image: archlinux/archlinux:base-devel
permissions:
contents: read
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 -p "${{ secrets.SSHPASS }}" ssh -o StrictHostKeyChecking=no parch@${{ secrets.SSHHOST }} "rm -rf ${{ env.REMOTE_DIR }} && mkdir -p ${{ env.REMOTE_DIR }}"
sshpass -p "${{ secrets.SSHPASS }}" rsync -avz out/ParchLinux-${{ env.Desktop }}-latest.iso out/md5sum.txt parch@${{ secrets.SSHHOST }}:${{ env.REMOTE_DIR }}