diff --git a/.github/workflows/ubuntu-wipe-clean.yml b/.github/workflows/ubuntu-wipe-clean.yml new file mode 100644 index 0000000..912e96a --- /dev/null +++ b/.github/workflows/ubuntu-wipe-clean.yml @@ -0,0 +1,44 @@ +name: Wipe Ubuntu Pool Clean (Danger) + +on: + workflow_dispatch: + +jobs: + build: + runs-on: self-hosted + container: + image: ghcr.io/pikaos-linux/pika-package-container:latest + volumes: + - /proc:/proc + options: --privileged -it + + steps: + - uses: actions/checkout@v3 + + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v5 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa + known_hosts: ${{ secrets.KNOWN_HOSTS }} + if_key_exists: replace + + - name: Sync Repository + run: chmod +x ./ubuntu-wipe-clean.sh && ./ubuntu-wipe-clean.sh + + - name: Purge cache + uses: jakejarvis/cloudflare-purge-action@master + env: + # Zone is required by both authentication methods + CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} + + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} + PURGE_URLS: ${{ vars.PURGE_URLS }} + diff --git a/ubuntu-wipe-clean.sh b/ubuntu-wipe-clean.sh new file mode 100755 index 0000000..15ae933 --- /dev/null +++ b/ubuntu-wipe-clean.sh @@ -0,0 +1,13 @@ +#! /bin/bash +set -e + +### In the Case of a major mishap we wipe the ubuntu pool clean and re run all repos +# Pull down existing ppa repo db files etc +mkdir -p ./output/repo +rsync -azP --exclude '*.deb' ferreo@direct.pika-os.com:/srv/www/pikappa/ ./output/repo + +# Remove our All package from the pool +reprepro -C ubuntu -V --basedir ./output/repo/ removefilter lunar 'Package (% *)' + +# Push the updated ppa repo to the server +rsync -azP ./output/repo/ ferreo@direct.pika-os.com:/srv/www/pikappa/ \ No newline at end of file