Skip to content

Commit

Permalink
feat(devops): add build and push image github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
apogiatzis committed Nov 21, 2024
1 parent b254257 commit 8aa6a92
Show file tree
Hide file tree
Showing 8 changed files with 1,235 additions and 1,236 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build_push_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
push:
branches:
- master

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GITHUB_ACTOR }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/cybermouflons/ovisbot:latest
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ python-dotenv = "*"
pymodm = "*"
texttable = "*"
requests = "*"
feedparser = "*"
colorthief = "*"
beautifulsoup4 = "*"
parse = "*"
Expand Down
2,403 changes: 1,196 additions & 1,207 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
bot:
build:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.reloading.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
live-reloader:
image: apogiatzis/livereloading
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2'
services:
bot:
build: .
Expand Down
34 changes: 10 additions & 24 deletions ovisbot/extensions/ctftime/ctftime.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
import logging
import re
import requests
import feedparser

import json
from bs4 import BeautifulSoup
import ctftime_helpers as ctfh

from colorthief import ColorThief
Expand Down Expand Up @@ -101,48 +98,37 @@ def rgb2hex(r, g, b):
)
await ctx.channel.send(embed=embed)

@ctftime.command( aliases = ["w"] )
@ctftime.command(aliases=["w"])
async def writeups(self, ctx, name):
"""
Returns the submitted writeups for a given CTF
!ctftime writeups <name>
!ctftime w <name>
"""
event = ctfh.Event( e_name = name )
event = ctfh.Event(e_name=name)
try:
ctf_name, ctf_writeups = event.find_event_writeups()
except ValueError:
await ctx.channel.send( "Could not find such event" )
await ctx.channel.send("Could not find such event")
return

for writeup in ctf_writeups:
info = writeup.__dict__

embed = discord.Embed(
title = info["name"],
url = "https://ctftime.org" + info["url"],
title=info["name"],
url="https://ctftime.org" + info["url"],
description=ctf_name,
color=0x8cff00
)
embed.add_field(
name = "Points",
value = info["points"],
inline = True
color=0x8CFF00,
)
embed.add_field(name="Points", value=info["points"], inline=True)
embed.add_field(
name = "Total Writeups",
value = info["no_writeups"],
inline = True
)
embed.add_field(
name = "Tags",
value = info["tags"],
inline = False
name="Total Writeups", value=info["no_writeups"], inline=True
)
embed.add_field(name="Tags", value=info["tags"], inline=False)

await ctx.channel.send(embed=embed)


@writeups.error
async def writeups_error(self, ctx, error):
if isinstance(error.original, ValueError):
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"colorama==0.4.3",
"colorthief==0.2.1",
"discord-py==1.4.1",
"feedparser==5.2.1",
"gitdb==4.0.5",
"gitpython==3.1.7",
"idna==2.10",
Expand Down

0 comments on commit 8aa6a92

Please sign in to comment.