From 0f96b284db526e92a1bed8ada2ed073b2e4fd12c Mon Sep 17 00:00:00 2001 From: Jan K9f Date: Thu, 24 Apr 2025 12:19:55 +0200 Subject: [PATCH 1/3] feat(ci): add build-image job to release workflow --- .gitea/workflows/release.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 05e146d..3e7b00e 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -31,3 +31,28 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + build-image: + needs: release + runs-on: ubuntu-latest + name: Build Docker Image + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Ensure full history is available + - name: Extract tag + run: | + TAG=$(git describe --tags --abbrev=0) + echo "TAG=$TAG" >> $GITHUB_ENV + - name: Checkout + uses: actions/checkout@v4 + - name: Build Image + run: docker buildx build -f backend/.docker/Dockerfile -t git.kjan.de/szut/casino-backend:${{ env.TAG }} -t git.kjan.de/szut/casino-backend:latest backend + - name: Login + uses: docker/login-action@v3 + with: + registry: git.kjan.de + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + - name: Push + run: docker push git.kjan.de/szut/casino-backend:latest -- 2.47.2 From d9324ee7f03c3f6d7fd6ae3aae789a5330b5864b Mon Sep 17 00:00:00 2001 From: Jan K9f Date: Thu, 24 Apr 2025 12:23:31 +0200 Subject: [PATCH 2/3] build(workflow): update Docker build and push actions --- .gitea/workflows/release.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 3e7b00e..e38a5a7 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -46,13 +46,18 @@ jobs: echo "TAG=$TAG" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 - - name: Build Image - run: docker buildx build -f backend/.docker/Dockerfile -t git.kjan.de/szut/casino-backend:${{ env.TAG }} -t git.kjan.de/szut/casino-backend:latest backend - name: Login uses: docker/login-action@v3 with: registry: git.kjan.de username: ${{ secrets.DOCKER_USER }} password: ${{ secrets.DOCKER_PASS }} - - name: Push - run: docker push git.kjan.de/szut/casino-backend:latest + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: backend/ + file: backend/.docker/Dockerfile + push: true + tags: | + git.kjan.de/szut/casino-backend:latest + git.kjan.de/szut/casino-backend:${{ env.TAG }} -- 2.47.2 From d2560c60493c06dd8270b7036b7168a06894aaf1 Mon Sep 17 00:00:00 2001 From: Jan K9f Date: Thu, 24 Apr 2025 12:24:27 +0200 Subject: [PATCH 3/3] chore: remove deploy workflow configuration file --- .gitea/workflows/deploy.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml deleted file mode 100644 index c6942ba..0000000 --- a/.gitea/workflows/deploy.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Deploy -on: - push: - branches: - - "main" - paths: - - "backend/**" - -jobs: - build-image: - runs-on: ubuntu-latest - name: Build Docker Image - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build Image - run: docker buildx build -f backend/.docker/Dockerfile -t git.kjan.de/szut/casino-backend:latest backend - - name: Login - uses: docker/login-action@v3 - with: - registry: git.kjan.de - username: ${{ secrets.DOCKER_USER }} - password: ${{ secrets.DOCKER_PASS }} - - name: Push - run: docker push git.kjan.de/szut/casino-backend:latest -- 2.47.2