Dockerfile and build github action

This commit is contained in:
Markbeep
2025-02-17 21:16:39 +01:00
parent e08d728bb6
commit dd1a72783d
7 changed files with 1416 additions and 8 deletions

55
.github/workflows/build.yaml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: Type check and Build
on:
- push
- pull_request
jobs:
test:
name: Test types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
cache: "pip"
- run: |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v2
with:
extra-args: app # only check apps dir
build:
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/audiobookrequest:latest