72 lines
2.1 KiB
YAML
72 lines
2.1 KiB
YAML
name: Build and Deploy ISO
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build_iso:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: archlinux/archlinux:base-devel
|
|
options: --privileged
|
|
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
|
|
- 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: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: iso-artifacts
|
|
path: |
|
|
out/ParchLinux-${{ env.Desktop }}-latest.iso
|
|
out/md5sum.txt
|
|
|
|
deploy_iso:
|
|
runs-on: docker
|
|
needs: [build_iso]
|
|
container:
|
|
image: archlinux/archlinux:base-devel
|
|
options: --privileged
|
|
env:
|
|
Desktop: "template"
|
|
SSH_HOST: ${{ secrets.SSHHOST }}
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: iso-artifacts
|
|
path: 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
|
|
env:
|
|
SSHPASS: ${{ secrets.SSHPASS }}
|
|
run: |
|
|
sshpass -e ssh -o StrictHostKeyChecking=no parch@${{ env.SSH_HOST }} "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.SSH_HOST }}:${{ env.REMOTE_DIR }}
|