Skip to content

Auto Sync App

Auto Sync App #70

# Created By : rtaserver
name: Auto Sync App
on:
schedule:
- cron: "00 19 * * *" # 02:00 GMT+7
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Set variables
run: |
echo "BUILDTIME=$(TZ=Asia/Jakarta date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
shell: bash
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set git identity
run : |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Jakarta"
- name: Clone Repo
working-directory: ./feeds/luci
run: |
function git_clone() {
if [ "$2" != "" ]; then
git clone --depth 1 $1 $2-new
if [ -d "$2" ]; then
echo "Direktori $2 Sudah Ada - SKIP"
else
mkdir $2
fi
mv -n $2-new/* ./$2
rm -fr $2-new
sed -i "/usign/ {/$2/! s/$/ $2/}" '../../list_packages.txt'
else
git clone --depth 1 $1
fi
}
function git_clone2() {
git clone --depth 1 $1
sed -i "/usign/ {/$2/! s/$/ $2/}" '../../list_packages.txt'
}
# Tutor Singkat Nambahin App Dari Repo Lain
# 1. Salin URL Repo yang mau di tambahkan
# 2. Untuk Repo Dengan Makefile Di Dalam Directory
# Gunakan Contoh Seperti Tunnel OpenClash / Passwall di Bawah Ini
# 3. Untuk Repo Dengan Makefile di Luar Directory
# Gunakan Contoh Seperti Theme Argon Di Bawah
(
#
# git_clone URL_REPO NAMA_PACKAGE >> Tutor Untuk No 3 Di Atas
# git_clone2 URL_REPO NAMA_PACKAGE >> Tutor Untuk No 2 Di Atas
# Tunnel
git_clone2 https://github.com/vernesong/OpenClash luci-app-openclash && mv -n OpenClash/luci-app-openclash ./; rm -rf OpenClash
git_clone2 https://github.com/rtaserver/openwrt-passwall luci-app-passwall && mv -n openwrt-passwall/luci-app-passwall ./; rm -fr openwrt-passwall
git_clone2 https://github.com/rtaserver/openwrt-passwall2 luci-app-passwall2 && mv -n openwrt-passwall2/luci-app-passwall2 ./; rm -fr openwrt-passwall2
git_clone https://github.com/rtaserver/luci-app-homeproxy luci-app-homeproxy
) &
(
# Theme
git_clone https://github.com/derisamedia/luci-theme-alpha luci-theme-alpha
git_clone https://github.com/jerrykuku/luci-theme-argon luci-theme-argon
git_clone https://github.com/jerrykuku/luci-app-argon-config luci-app-argon-config
) &
(
# ETC
git_clone https://github.com/animegasan/luci-app-quickstart luci-app-quickstart
git_clone https://github.com/animegasan/luci-app-ipinfo luci-app-ipinfo
git_clone https://github.com/muink/luci-app-tinyfilemanager luci-app-tinyfilemanager
git_clone https://github.com/rtaserver/luci-app-cloudflared luci-app-cloudflared
)
- name: Run Patch File
working-directory: ./.github/patch
run: |
echo "Patch OpenClash."
sh patch-oc.sh
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_options: '--no-verify --signoff'
# add_options: '-u'
push_options: '--force'
# skip_dirty_check: true
commit_message: "πŸŽ‰ Sync: ${{ env.BUILDTIME }}"
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@main
continue-on-error: true
with:
retain_days: 1