feat: Initialize project

This commit is contained in:
oSumAtrIX
2024-02-01 04:12:05 +01:00
parent bf5eaa8940
commit 8ae50b543e
81 changed files with 4005 additions and 6302 deletions

View File

@@ -1,54 +0,0 @@
name: "CodeQL"
on:
push:
branches: [dev]
pull_request:
types: [opened, reopened, edited, synchronize]
schedule:
- cron: "29 5 * * 5"
workflow_dispatch:
jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["python"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11.7"
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ];
then pip install -r requirements.txt;
fi
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View File

@@ -1,69 +0,0 @@
name: Build dev branch
on:
push:
branches: [ "dev" ]
schedule:
- cron: '24 9 * * 6'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_TAG: ${{ github.sha }}
jobs:
security_checks:
runs-on: ubuntu-latest
name: Security check
steps:
- uses: actions/checkout@v4
- name: Security Checks (PyCharm Security)
uses: tonybaloney/pycharm-security@master
with:
path: .
build:
needs: security_checks
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Dockerfile
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ startsWith(github.ref, 'refs/heads/main') }}
suffix=-${{ github.sha }}
- name: Build Docker image
id: build
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@@ -1,67 +0,0 @@
name: Build and Publish Docker Image
on:
push:
branches: [main]
schedule:
- cron: "24 9 * * 6"
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_TAG: ${{ github.sha }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout Dockerfile
id: checkout
uses: actions/checkout@v4
- name: Setup QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
id: ghcr
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ startsWith(github.ref, 'refs/heads/main') }}
suffix=-${{ github.sha }}
- name: Build and push main Docker image
id: build
uses: docker/build-push-action@v5
with:
build-args: GH_TOKEN=${{ secrets.GH_TOKEN }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64/v8
cache-to: type=gha,mode=max,ignore-error=true
cache-from: type=gha
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}