system-helpers/.forgejo/workflows/build.yaml

45 lines
1.6 KiB
YAML
Raw Normal View History

2023-08-16 23:18:13 +00:00
on: [ push ]
jobs:
build:
runs-on: docker
container:
image: archlinux/archlinux:base-devel
steps:
- name: Prepare requirements
run: |
2023-08-16 23:21:14 +00:00
pacman -Syu --noconfirm
pacman -Sy --noconfirm nodejs npm git
2023-08-16 23:53:04 +00:00
pacman -Sy --noconfirm shellcheck rsync openssh coreutils
2023-08-16 23:18:13 +00:00
- uses: actions/checkout@v3
name: Clone
- name: Shellcheck
run: |
find usr/local/bin -type f -exec echo Testing {} \; -exec shellcheck {} \;
- name: Build ArchLinux package
run: |
useradd -m build
cp -r ${{ github.workspace }}/_pkg/ /home/build/
chown -R build:build /home/build
cd /home/build/_pkg
sudo -u build makepkg -csf
sudo -u build repo-add repo-aur-myservermanager-com.db.tar.gz *.zst
cp *.zst ${{ github.workspace }}/_pkg/
cp *.tar.gz ${{ github.workspace }}/_pkg/
2023-08-16 23:39:30 +00:00
echo "Produced package and AUR contents"
2023-08-16 23:29:23 +00:00
ls -la ${{ github.workspace }}/_pkg/
2023-08-16 23:18:13 +00:00
2023-08-16 23:39:30 +00:00
- name: Synchronize to custom ArchLinux User Repository
env:
KEY: ${{ secrets.DEPLOY_SSH_KEY }}
USER: ${{ secrets.DEPLOY_SSH_USER }}
HOST: ${{ secrets.DEPLOY_SSH_HOST }}
run: |
mkdir -p ~/.ssh
2023-08-17 21:42:54 +00:00
which base64
2023-08-16 23:39:30 +00:00
echo $KEY | base64 -d >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
rsync -az -zz -r --del -e 'ssh -p 2222 -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o StrictHostKeyChecking=no' ${{ github.workspace }}/_pkg/{*.zst,*.db.tar.gz,*.files.tar.gz} $USER@$HOST:/srv/http/myservermanager.com/htdocs/aur/