Use GitHub Actions instead of Gitea Actions
This commit is contained in:
parent
bda9e424e5
commit
f70f870a7b
2 changed files with 15 additions and 22 deletions
4
.github/renovate.json
vendored
4
.github/renovate.json
vendored
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["config:recommended"],
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
],
|
||||
"automerge": true,
|
||||
"configMigration": true,
|
||||
"dependencyDashboard": false,
|
||||
|
|
|
|||
89
.github/workflows/build.yml
vendored
Normal file
89
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
---
|
||||
name: Test and build Docker image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 15 * * 0"
|
||||
|
||||
env:
|
||||
TEST_WEBHOOK_URL: ${{ secrets.TEST_WEBHOOK_URL }}
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
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 }}
|
||||
|
||||
# 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
|
||||
cache-image: false
|
||||
|
||||
# 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 .
|
||||
|
||||
# Set up Python 3.13
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.13
|
||||
|
||||
# Install dependencies
|
||||
- uses: astral-sh/setup-uv@v5
|
||||
with:
|
||||
version: "latest"
|
||||
- run: uv sync --all-extras --all-groups
|
||||
|
||||
# Run tests
|
||||
- run: uv run pytest
|
||||
|
||||
# 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/discord-rss-bot
|
||||
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 }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue