From 544f78a369015985728aa7b252328fa1fdddf364 Mon Sep 17 00:00:00 2001 From: Aidan Date: Sat, 1 Mar 2025 16:28:25 -0500 Subject: [PATCH] docs/ci: migrate ci to github, update docs with badge, ignore misc. files --- .github/workflows/bump.yml | 42 +++++++++++++++++++ .../workflows/docker.yml | 14 +++---- .gitignore | 8 +++- README.md | 5 ++- 4 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/bump.yml rename .gitea/workflows/docker.yaml => .github/workflows/docker.yml (60%) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..83ae10e --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,42 @@ +name: Bump Dependencies + +on: + push: + branches: + - main + schedule: + - cron: "0 0 * * *" + - cron: "0 12 * * *" + +jobs: + update-dependencies: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + + - name: Install Dependencies + run: bun install + + - name: Update Dependencies + run: bun update + + - name: Commit and Push Changes + env: + USERNAME_GITEA: ${{ secrets.USERNAME_GITEA }} + TOKEN_GITEA: ${{ secrets.TOKEN_GITEA }} + SERVER_URL: ${{ secrets.SERVER_URL }} + run: | + git config --global user.name "LibreCloud Actions Bot" + git config --global user.email "git@pontusmail.org" + echo "Connecting to $SERVER_URL" + git remote set-url origin https://${USERNAME_GITEA}:${TOKEN_GITEA}@git.pontusmail.org/aidan/request-bot.git + git add . + git commit -m "chore: bump dependencies" || exit 0 + git push origin main \ No newline at end of file diff --git a/.gitea/workflows/docker.yaml b/.github/workflows/docker.yml similarity index 60% rename from .gitea/workflows/docker.yaml rename to .github/workflows/docker.yml index d4b48cd..1bebb3e 100644 --- a/.gitea/workflows/docker.yaml +++ b/.github/workflows/docker.yml @@ -14,17 +14,17 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Log in to Gitea Package Registry - run: echo "${{ secrets.PACKAGE_TOKEN }}" | docker login $SERVER_URL -u $USERNAME --password-stdin - env: - SERVER_URL: ${{ secrets.SERVER_URL }} - USERNAME: ${{ secrets.USERNAME }} - PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} + uses: docker/login-action@v3 + with: + registry: ${{ secrets.SERVER_URL }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PACKAGE_TOKEN }} - name: Build Docker Image run: docker build -t git.pontusmail.org/aidan/request-bot:latest . - name: Push Docker Image - run: docker push git.pontusmail.org/aidan/request-bot:latest + run: docker push git.pontusmail.org/aidan/request-bot:latest \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5694b9d..01e2bef 100644 --- a/.gitignore +++ b/.gitignore @@ -130,4 +130,10 @@ dist .pnp.* # database -responses.json \ No newline at end of file +responses.json + +# bun +bun.lockb + +# idea +.idea/ \ No newline at end of file diff --git a/README.md b/README.md index 7b8321c..e19a878 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # request-bot +[![Build and Push Docker Image](https://github.com/ihatenodejs/request-bot/actions/workflows/docker.yml/badge.svg)](https://github.com/ihatenodejs/request-bot/actions/workflows/docker.yml) +[![Bump Dependencies](https://github.com/ihatenodejs/request-bot/actions/workflows/bump.yml/badge.svg)](https://github.com/ihatenodejs/request-bot/actions/workflows/bump.yml) + A Telegram bot which takes requests for modules.lol -## Setting up and self hosting +## Setting up and self-hosting ### Using Docker