mirror of
https://github.com/TheLovinator1/discord-reminder-bot.git
synced 2025-07-12 16:53:28 +02:00
Go back to GitHub workflows
This commit is contained in:
@ -1,37 +0,0 @@
|
|||||||
name: uv
|
|
||||||
|
|
||||||
on:
|
|
||||||
# push:
|
|
||||||
# pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
# schedule:
|
|
||||||
# - cron: "0 6 * * *"
|
|
||||||
|
|
||||||
env:
|
|
||||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
|
||||||
TIMEZONE: Europe/Stockholm
|
|
||||||
LOG_LEVEL: Info
|
|
||||||
SQLITE_LOCATION: /data/jobs.sqlite
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-on-uv:
|
|
||||||
name: Install with uv and run tests on Python 3.13
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- run: |
|
|
||||||
if [ -z "${{ env.BOT_TOKEN }}" ]; then
|
|
||||||
echo "BOT_TOKEN not set"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install uv and set the python version to 3.13
|
|
||||||
uses: astral-sh/setup-uv@v5
|
|
||||||
with:
|
|
||||||
python-version: 3.13
|
|
||||||
version: "latest"
|
|
||||||
- name: Install dependencies
|
|
||||||
run: uv sync --all-extras --dev
|
|
||||||
- name: Run tests
|
|
||||||
run: uv run pytest
|
|
@ -5,7 +5,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "@weekly"
|
- cron: '0 16 * * 0'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
|
||||||
@ -16,34 +16,45 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-push-docker:
|
build-and-push-docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: astral-sh/setup-uv@v5
|
|
||||||
with:
|
|
||||||
python-version: 3.13
|
|
||||||
- run: uv sync --all-extras --dev
|
|
||||||
- run: uv run pytest
|
|
||||||
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
|
|
||||||
with:
|
|
||||||
platforms: all
|
|
||||||
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
|
|
||||||
- uses: docker/login-action@3d100841f68d4548bf57e52eb27bd33ec5069f55
|
- uses: docker/login-action@3d100841f68d4548bf57e52eb27bd33ec5069f55
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- uses: docker/login-action@3d100841f68d4548bf57e52eb27bd33ec5069f55
|
- uses: docker/login-action@3d100841f68d4548bf57e52eb27bd33ec5069f55
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
|
||||||
|
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86
|
||||||
|
with:
|
||||||
|
python-version: 3.13
|
||||||
|
|
||||||
|
- run: uv sync --all-extras --dev
|
||||||
|
- run: uv run pytest
|
||||||
|
|
||||||
|
- uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
|
||||||
|
|
||||||
- uses: docker/build-push-action@v6
|
- uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64, linux/arm64
|
platforms: linux/amd64, linux/arm64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: thelovinator/discord-reminder-bot:latest
|
tags: thelovinator/discord-reminder-bot:latest
|
||||||
|
|
||||||
- uses: docker/build-push-action@v6
|
- uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
Reference in New Issue
Block a user