Skip to content

[ci rebuild sources] #12

[ci rebuild sources]

[ci rebuild sources] #12

name: Rebuild Sources
on:
push:
branches-ignore:
- main
jobs:
build:
runs-on: ubuntu-24.04
if: "contains(github.event.head_commit.message, '[ci rebuild sources]')"
steps:
- uses: actions/checkout@v4
- name: Set Job Parameters
id: init
run: |
echo "PKG_BUILD_DIR=${{ github.workspace }}/packages" >> $GITHUB_OUTPUT
- name: Env setup
run: |
set -e
sudo apt update
DEBIAN_FRONTEND=noninteractive sudo apt install -y --no-install-recommends jq git devscripts wget dput
export DEBEMAIL="[email protected]"
export DEBFULLNAME="Regolith Linux"
export DEBIAN_FRONTEND=noninteractive
mkdir -p ~/.gnupg/
printf "${{ secrets.PACKAGE_PRIVATE_KEY2 }}" | base64 --decode > ~/.gnupg/private.key
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.KAMATERA_SSH_KEY }}
- name: Pull repo
run: |
set -e
set -x
ssh-keyscan -H ${{ secrets.KAMATERA_HOSTNAME2 }} >> ~/.ssh/known_hosts
mkdir -p "${{ steps.init.outputs.PKG_BUILD_DIR }}"
rsync \
-rlptDvzh \
--include="*.orig.tar.gz" \
--include="*.debian.tar.xz" \
--exclude="*/*/*_*/" \
--exclude="*/*/*/*" \
root@${{ secrets.KAMATERA_HOSTNAME2 }}:/opt/archives/repos-merged/ "${{ steps.init.outputs.PKG_BUILD_DIR }}"
- name: Build
run: |
set -e
sudo ./migrate/scripts/rebuild-sources.sh "${{ steps.init.outputs.PKG_BUILD_DIR }}"
- name: Deploy via rsync
run: |
set -e
set -x
for i in 1 2 3 4 5; do echo "Attempt $i" && rsync -avzh ${{ steps.init.outputs.PKG_BUILD_DIR }}/ root@${{ secrets.KAMATERA_HOSTNAME2 }}:/opt/archives/repos-merged/ && break || sleep 5; done