commit d4c5352b757ac10deb4617ad4ce1f77f89a6d6e9 Author: Evan Ferrao Date: Mon May 15 23:42:26 2023 +0530 Alist Mirror: Initial Repo diff --git a/.github/workflows/Build_Alist.yaml b/.github/workflows/Build_Alist.yaml new file mode 100644 index 0000000..db57506 --- /dev/null +++ b/.github/workflows/Build_Alist.yaml @@ -0,0 +1,56 @@ +name: Build Alist + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * 0' + +jobs: + docker-build: + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + packages: write + steps: + + - name: Pull xhofe/alist & xhofe/alist-aria2 + run: | + docker pull xhofe/alist:latest; docker pull xhofe/alist-aria2:latest + docker tag xhofe/alist:latest boxinaclosedbox/alist:latest + docker tag xhofe/alist:latest ghcr.io/boxinaclosedbox/alist:latest + docker tag xhofe/alist-aria2:latest boxinaclosedbox/alist:latest-aria2 + docker tag xhofe/alist-aria2:latest ghcr.io/boxinaclosedbox/alist:latest-aria2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push Images + run: | + docker push boxinaclosedbox/alist:latest + docker push ghcr.io/boxinaclosedbox/alist:latest + docker push boxinaclosedbox/alist:latest-aria2 + docker push ghcr.io/boxinaclosedbox/alist:latest-aria2 + docker logout + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME_2 }} + password: ${{ secrets.DOCKERHUB_TOKEN_2 }} + + - name: Push to alternate account + run: | + docker tag xhofe/alist:latest ${{ secrets.DOCKERHUB_USERNAME_2 }}/${{ secrets.NEW_IMAGE_NAME }}:latest + docker tag xhofe/alist-aria2:latest ${{ secrets.DOCKERHUB_USERNAME_2 }}/${{ secrets.NEW_IMAGE_NAME }}:latest-aria2 + docker push ${{ secrets.DOCKERHUB_USERNAME_2 }}/${{ secrets.NEW_IMAGE_NAME }}:latest + docker push ${{ secrets.DOCKERHUB_USERNAME_2 }}/${{ secrets.NEW_IMAGE_NAME }}:latest-aria2 \ No newline at end of file diff --git a/.github/workflows/Keep-Alive.yaml b/.github/workflows/Keep-Alive.yaml new file mode 100644 index 0000000..208f423 --- /dev/null +++ b/.github/workflows/Keep-Alive.yaml @@ -0,0 +1,27 @@ +name: Keep Actions Alive + +on: + workflow_dispatch: + schedule: + - cron: '2 1 2 * *' +jobs: + KeepAlive: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkouts + uses: actions/checkout@v3 + + - name: Commit to 'keepalive' branch + run: | + REPO_URL=$(git config --get remote.origin.url) ; REPO_BASE=$(echo "${REPO_URL}" |sed 's/.*\/\///g') ; USERNAME=$(echo $REPO_BASE |sed 's/\/.*//g') ; GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}} + if [ "${GITHUB_EMAIL}" = "" ]; then GITHUB_EMAIL=boxinaclosedbox@gmail.com ; fi ; git config --global user.email "${GITHUB_EMAIL}" + if [ "${GITHUB_USERNAME}" = "" ]; then GITHUB_USERNAME="Box In A Box" ; fi ; git config --global user.name "${GITHUB_USERNAME}" + rm -rf * .git .github + echo "${RANDOM}${RANDOM}${RANDOM}${RANDOM}${RANDOM}" >> Random.txt + git init ; git add Random.txt + git commit -m "KeepALive As of \"$(date)\"" + git remote add origin https://"{USERNAME}":"${GITHUB_TOKEN}"@"${REPO_BASE}" + git checkout -b keepalive + git push --set-upstream origin keepalive -f \ No newline at end of file