This commit is contained in:
2024-07-07 16:59:47 +02:00
commit 139430c2f8
7 changed files with 346 additions and 0 deletions

47
.github/workflows/docker-publish.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: Build and Push Docker Image
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
docker:
name: Create Docker Image
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.4.0
- name: Log in to DockerHub
uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5.5.1
with:
images: |
alterware/aw-bot
tags: |
${{ github.ref_name }}
latest
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6.3.0
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

32
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Lint
on: [push, pull_request]
env:
PIP_ROOT_USER_ACTION: "ignore"
jobs:
lint:
name: Lint Python code
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pip
run: |
sudo apt-get update
sudo apt-get install -y python3-pip
- name: Upgrade pip
run: |
python3 -m pip install --upgrade pip
pip --version
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run flake8
run: |
flake8 .