From 98c7e139146c4cb50b1625220c46ef954a4d8f46 Mon Sep 17 00:00:00 2001 From: Aleksandr Tcitlionok <803797+terghalin@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:23:17 +0000 Subject: [PATCH] fix(ci): use gitea instead --- .gitea/workflows/ci.yaml | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..cb074f7 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,47 @@ +name: CI Pipeline + +on: + push: + branches: + - main + pull_request: + branches: + - main + +env: + IMAGE_NAME: terghalin/metalcheck-backend + +jobs: + build-and-push: + name: Build and Push Docker Image + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.IMAGE_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Cache Python dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Build and Push Docker Image + uses: docker/build-push-action@v4 + with: + push: true + tags: | + ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest + ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}