i dunno man

This commit is contained in:
Luke Robles 2024-05-12 21:03:23 -07:00
parent 8895105a15
commit 0e196b83c5
2 changed files with 9 additions and 35 deletions

View File

@ -1,18 +1,9 @@
name: Build and push name: Build and push
run-name: ${{ gitea.actor }} Triggered a new run 🚀 run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push] on: [push]
jobs: jobs:
post-startup-message: changes:
runs-on: ubuntu-latest
steps:
- uses: sarisia/actions-status-discord@v1
if: always()
with:
title: "Pipeline is starting 🚀"
webhook: ${{ secrets.DISCORD_WEBHOOK }}
avatar_url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTP3ekDW_jiUIEmAym337xeS7WN-k_DUq8YHi6VVfwQQw&s"
detect-changed-files:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
python_files: ${{ steps.filter.outputs.python_files }} python_files: ${{ steps.filter.outputs.python_files }}
@ -30,8 +21,8 @@ jobs:
- 'helm/**' - 'helm/**'
Lint-Python: Lint-Python:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: detect-changed-files needs: changes
if: ${{ needs.detect-changed-files.outputs.python_files == 'true' }} if: ${{ needs.changes.outputs.python_files == 'true' }}
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -50,10 +41,9 @@ jobs:
uv pip install black --system --quiet uv pip install black --system --quiet
black app --check --fast black app --check --fast
if: steps.filter.outputs.python_files == 'true' if: steps.filter.outputs.python_files == 'true'
Build-and-Push-Docker: Build-and-Push-Docker:
needs: detect-changed-files needs: [changes, Lint-Python]
if: ${{ (needs.detect-changed-files.outputs.python_files == 'true') && (steps.Lint-Python.outcome == 'success') }} if: ${{ needs.changes.outputs.python_files == 'true' }}
steps: steps:
- name: Login to Docker Hub - name: Login to Docker Hub
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
@ -61,12 +51,9 @@ jobs:
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }} password: ${{ secrets.DOCKER_TOKEN }}
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Build and push - name: Build and push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: . context: .
@ -74,10 +61,9 @@ jobs:
tags: | tags: |
ldooks/dragon-bot:latest ldooks/dragon-bot:latest
ldooks/dragon-bot:${{ gitea.run_id }} ldooks/dragon-bot:${{ gitea.run_id }}
sync-argocd-app: sync-argocd-app:
needs: [detect-changed-files, Build-and-Push-Docker] needs: [changes, Build-and-Push-Docker]
if: ${{ (needs.detect-changed-files.outputs.python_files == 'true') && (steps.Build-and-Push-Docker.outcome == 'success') }} if: ${{ needs.changes.outputs.python_files == 'true' }}
steps: steps:
- name: Sync app in ArgoCD - name: Sync app in ArgoCD
uses: clowdhaus/argo-cd-action/@main uses: clowdhaus/argo-cd-action/@main
@ -85,15 +71,3 @@ jobs:
version: 2.6.7 version: 2.6.7
command: app command: app
options: --insecure --server 192.168.1.205 --auth-token ${{ secrets.ARGOCD_TOKEN }} set dragon-bot --helm-set image.tag=${{ gitea.run_id }} options: --insecure --server 192.168.1.205 --auth-token ${{ secrets.ARGOCD_TOKEN }} set dragon-bot --helm-set image.tag=${{ gitea.run_id }}
post-finish-message:
runs-on: ubuntu-latest
if: ${{ (steps.Build-and-Push-Docker.outcome == 'success') }}
steps:
- uses: sarisia/actions-status-discord@v1
if: always()
with:
title: "Pipeline has completed successfully"
status:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
avatar_url: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTP3ekDW_jiUIEmAym337xeS7WN-k_DUq8YHi6VVfwQQw&s"

View File

@ -185,7 +185,7 @@ class ServerUtils(commands.Cog):
await ctx.channel.purge(limit=int(count), check=is_me) await ctx.channel.purge(limit=int(count), check=is_me)
await ctx.respond("ok", delete_after=2) await ctx.respond("ok", delete_after=1)
@commands.slash_command( @commands.slash_command(
guild_ids=None, name="cleanup", description="cleanup bot messages" guild_ids=None, name="cleanup", description="cleanup bot messages"