From e7722b654c7a55c96bc6eadd62338251cf8656a1 Mon Sep 17 00:00:00 2001 From: Daniel Dolezal Date: Sat, 18 Oct 2025 19:02:07 +0200 Subject: [PATCH] add new gitea build action --- .gitea/workflows/prod-docker-images.yml | 47 +++++++++++++++++++++++++ .github/workflows/docker-image.yml | 31 ---------------- 2 files changed, 47 insertions(+), 31 deletions(-) create mode 100644 .gitea/workflows/prod-docker-images.yml delete mode 100644 .github/workflows/docker-image.yml diff --git a/.gitea/workflows/prod-docker-images.yml b/.gitea/workflows/prod-docker-images.yml new file mode 100644 index 0000000..129e4cd --- /dev/null +++ b/.gitea/workflows/prod-docker-images.yml @@ -0,0 +1,47 @@ +name: Build and Push Docker Container + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # --- Logins --- + - name: Login to Gitea Registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.DOCKER_REGISTRY_URL }} + username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} + password: ${{ secrets.ACTION_ACCESS_TOKEN }} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Repo owner to lowercase (for Gitea namespace) + run: echo "REPO_OWNER_LC=$(echo '${{ gitea.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV + + # ---------------- BRANCH BUILD (master) ---------------- + # On Branch: Gitea and Docker Hub :latest + - name: Build & push (branch -> only :latest everywhere) + if: ${{ github.ref_type == 'branch' && github.ref == 'refs/heads/master' }} + uses: docker/build-push-action@v6 + with: + context: . + push: true + platforms: linux/amd64 + tags: | + ${{ vars.DOCKER_REGISTRY_URL }}/${{ env.REPO_OWNER_LC }}/pfsense-backup:latest + ${{ secrets.DOCKERHUB_USERNAME }}/pfsense-backup:latest diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 852557f..0000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Build and Push Docker Container -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build-and-push: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - 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 Docker image for latest tag - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: daniel156161/pfsense-backup:latest - platforms: linux/amd64