Skip to content

Update astral-sh/setup-uv action to v8 - autoclosed #678

Update astral-sh/setup-uv action to v8 - autoclosed

Update astral-sh/setup-uv action to v8 - autoclosed #678

Workflow file for this run

---
name: Test code; build Docker image; push to Docker Hub, GitHub Container Registry.
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # Weekly on Sunday at midnight UTC
env:
SERVE_DOMAIN: https://localhost/
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
UPLOAD_FOLDER: ./Uploads
jobs:
test:
runs-on: ubuntu-latest
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 }}
# Docker Hub Registry
- uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: docker.io
username: thelovinator
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Download the latest commit from the master branch
- uses: actions/checkout@v6
# Set up QEMU
- id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:master
platforms: linux/amd64,linux/arm64
cache-image: true
# Set up Buildx so we can build multi-arch images
- uses: docker/setup-buildx-action@v3
# Set up uv for Python dependency management
- uses: astral-sh/setup-uv@v8.3.0
id: setup-uv
with:
enable-cache: true
version: "latest"
# Run tests
- run: uv run pytest
# 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
with:
images: |
ghcr.io/thelovinator1/discord-embed
thelovinator/discord-nice-embed-maker-for-my-yoy
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=raw,value=master,enable=${{ github.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: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}