name: Build and Deploy on Tag
on:
  push:
    tags:
      - "v*"

env:
  GITEA_AUTH: ${{ secrets.MY_GITEA_AUTH }}

jobs:
  build-arch:
    runs-on: arch-builder
    steps:
      - uses: actions/checkout@v4
      - run: pacman --noconfirm -Sy mbedtls curl
      - run: pacman --config /opt/cross/ppc/pacman.conf --noconfirm -Sy mbedtls
      - run: cp Packaging/Linux/PKGBUILD /home/build/PKGBUILD
      - run: cp Packaging/Linux/build-arch.sh /home/build/build-arch.sh
      - run: chmod 755 /home/build/build-arch.sh
      - run: chown build:build /home/build/PKGBUILD
      - run: chown build:build /home/build/build-arch.sh
      - run: su build -c /home/build/build-arch.sh
