ANewDawn/.github/workflows/docker-publish.yml
Workflow config file is invalid. Please check your config file: Line: 10 Column 5: Failed to match job-factory: Line: 51 Column 9: Failed to match run-step: Line: 52 Column 9: Unknown Property uses Line: 55 Column 9: Unknown Property with Line: 51 Column 9: Failed to match regular-step: Line: 57 Column 17: Unknown Variable Access gitea Line: 60 Column 9: Failed to match run-step: Line: 60 Column 9: Unknown Property uses Line: 61 Column 9: Unknown Property with Line: 60 Column 9: Failed to match regular-step: Line: 64 Column 17: Unknown Variable Access gitea Line: 10 Column 5: Failed to match workflow-job: Line: 11 Column 5: Unknown Property env Line: 14 Column 5: Unknown Property steps Forgejo Actions YAML Schema validation error
2025-07-24 23:56:51 +02:00

67 lines
1.9 KiB
YAML

name: Build Docker Image
on:
push:
pull_request:
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
env:
DISCORD_TOKEN: "0"
OPENAI_TOKEN: "0"
steps:
# GitHub Container Registry
- uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: thelovinator1
password: ${{ secrets.GITHUB_TOKEN }}
# Download the latest commit from the master branch
- uses: actions/checkout@v4
# Set up QEMU
- id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:master
platforms: linux/amd64,linux/arm64
# Set up Buildx so we can build multi-arch images
- uses: docker/setup-buildx-action@v3
# Install the latest version of ruff
- uses: 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: docker/metadata-action@v5
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
with:
images: ghcr.io/thelovinator1/anewdawn
tags: type=raw,value=latest,enable=${{ gitea.ref == format('refs/heads/{0}', 'master') }}
# Build and push the Docker image
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ gitea.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}