From 07452d8c43904cfe02e5d6baa268d3bff4ba0ee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Thu, 16 Nov 2023 16:51:52 +0100 Subject: [PATCH] Re-instance gitea actions --- .gitea/workflows/build-docker.yml | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .gitea/workflows/build-docker.yml diff --git a/.gitea/workflows/build-docker.yml b/.gitea/workflows/build-docker.yml new file mode 100644 index 0000000..b34589e --- /dev/null +++ b/.gitea/workflows/build-docker.yml @@ -0,0 +1,50 @@ +name: Django CI/CD + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.12 + uses: actions/setup-python@v2 + with: + python-version: 3.12 + - name: Install Poetry + run: | + python -m pip install poetry + echo "$HOME/.local/bin" >> $GITHUB_PATH + - name: Install Dependencies + run: | + poetry install + - name: Apply migrations + run: | + poetry run python manage.py migrate + - name: Run Tests + run: | + poetry run python manage.py test + + build-and-push: + needs: test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + registry.kucharczyk.xyz/timetracker:latest + registry.kucharczyk.xyz/timetracker:${{ env.VERSION_NUMBER }} + env: + VERSION_NUMBER: 1.5.1