Compare commits
6 Commits
bd0c66e0fd
...
master
Author | SHA1 | Date | |
---|---|---|---|
0d36a591fb
|
|||
83d3365a85
|
|||
e4b9b8129b
|
|||
7bbbbc2309
|
|||
dcfb467858
|
|||
7582fa9642
|
@ -1,19 +0,0 @@
|
|||||||
name: Docker Build Check
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'Dockerfile'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'Dockerfile'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker-check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Run Docker Build Check
|
|
||||||
run: docker build --check .
|
|
@ -9,39 +9,13 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "@daily"
|
- cron: "@daily"
|
||||||
|
|
||||||
cache:
|
|
||||||
enabled: true
|
|
||||||
dir: ""
|
|
||||||
host: "192.168.1.127"
|
|
||||||
port: 8088
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DISCORD_TOKEN: "0"
|
DISCORD_TOKEN: "0"
|
||||||
OPENAI_TOKEN: "0"
|
OPENAI_TOKEN: "0"
|
||||||
if: gitea.event_name != 'pull_request'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
|
||||||
- uses: https://github.com/docker/setup-qemu-action@v3
|
|
||||||
- uses: https://github.com/docker/setup-buildx-action@v3
|
|
||||||
- uses: https://github.com/astral-sh/ruff-action@v3
|
|
||||||
|
|
||||||
- run: docker build --check .
|
|
||||||
- run: ruff check --exit-non-zero-on-fix --verbose
|
|
||||||
- run: ruff format --check --verbose
|
|
||||||
|
|
||||||
- id: meta
|
|
||||||
uses: https://github.com/docker/metadata-action@v5
|
|
||||||
env:
|
|
||||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
ghcr.io/thelovinator1/anewdawn
|
|
||||||
git.lovinator.space/thelovinator/anewdawn
|
|
||||||
tags: type=raw,value=latest,enable=${{ gitea.ref == format('refs/heads/{0}', 'master') }}
|
|
||||||
|
|
||||||
# GitHub Container Registry
|
# GitHub Container Registry
|
||||||
- uses: https://github.com/docker/login-action@v3
|
- uses: https://github.com/docker/login-action@v3
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
@ -56,11 +30,53 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
registry: git.lovinator.space
|
registry: git.lovinator.space
|
||||||
username: thelovinator
|
username: thelovinator
|
||||||
password: ${{ secrets.GITEA_TOKEN }}
|
password: ${{ secrets.PACKAGES_WRITE_GITEA_TOKEN }}
|
||||||
|
|
||||||
|
# Download the latest commit from the master branch
|
||||||
|
- uses: https://github.com/actions/checkout@v4
|
||||||
|
|
||||||
|
# Set up QEMU
|
||||||
|
- id: qemu
|
||||||
|
uses: https://github.com/docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
image: tonistiigi/binfmt:master
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
cache-image: false
|
||||||
|
|
||||||
|
# Set up Buildx so we can build multi-arch images
|
||||||
|
- uses: https://github.com/docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
|
||||||
|
# Install the latest version of ruff
|
||||||
|
- uses: https://github.com/astral-sh/ruff-action@v3
|
||||||
|
with:
|
||||||
|
version: "latest"
|
||||||
|
|
||||||
|
# Lint the Python code using ruff
|
||||||
|
- run: ruff check --exit-non-zero-on-fix --verbose
|
||||||
|
|
||||||
|
# Check if the Python code needs formatting
|
||||||
|
- run: ruff format --check --verbose
|
||||||
|
|
||||||
|
# Lint Dockerfile
|
||||||
|
- run: docker build --check .
|
||||||
|
|
||||||
|
# Extract metadata (tags, labels) from Git reference and GitHub events for Docker
|
||||||
|
- id: meta
|
||||||
|
uses: https://github.com/docker/metadata-action@v5
|
||||||
|
env:
|
||||||
|
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/thelovinator1/anewdawn
|
||||||
|
git.lovinator.space/thelovinator/anewdawn
|
||||||
|
tags: type=raw,value=latest,enable=${{ gitea.ref == format('refs/heads/{0}', 'master') }}
|
||||||
|
|
||||||
|
# Build and push the Docker image
|
||||||
- uses: https://github.com/docker/build-push-action@v6
|
- uses: https://github.com/docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
push: ${{ gitea.event_name != 'pull_request' }}
|
push: ${{ gitea.event_name != 'pull_request' }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
name: Ruff
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * *' # Run every day at midnight
|
|
||||||
|
|
||||||
env:
|
|
||||||
RUFF_OUTPUT_FORMAT: github
|
|
||||||
jobs:
|
|
||||||
ruff:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: astral-sh/ruff-action@v3
|
|
||||||
- run: ruff check --exit-non-zero-on-fix --verbose
|
|
||||||
- run: ruff format --check --verbose
|
|
19
.github/workflows/docker-check.yml
vendored
19
.github/workflows/docker-check.yml
vendored
@ -1,19 +0,0 @@
|
|||||||
name: Docker Build Check
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'Dockerfile'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'Dockerfile'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker-check:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Run Docker Build Check
|
|
||||||
run: docker build --check .
|
|
@ -1,6 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
# check=error=true;experimental=all
|
# check=error=true;experimental=all
|
||||||
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim@sha256:73c021c3fe7264924877039e8a449ad3bb380ec89214282301affa9b2f863c5d
|
FROM --platform=$BUILDPLATFORM ghcr.io/astral-sh/uv:python3.13-bookworm-slim@sha256:73c021c3fe7264924877039e8a449ad3bb380ec89214282301affa9b2f863c5d
|
||||||
|
|
||||||
# Change the working directory to the `app` directory
|
# Change the working directory to the `app` directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
Reference in New Issue
Block a user