diff --git a/.gitea/workflows/dev.yml b/.gitea/workflows/dev.yml index 9f6b468..3bb44de 100644 --- a/.gitea/workflows/dev.yml +++ b/.gitea/workflows/dev.yml @@ -1,31 +1,36 @@ -name: Build and Push Docker Image +name: Docker Build and Push for Main Branch on: push: + paths-ignore: + - ".gitignore" + - "README.md" + - "LICENSE" branches: - - dev + - main jobs: - build: + docker: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - - name: Login to Registry + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub uses: docker/login-action@v2 with: registry: git.phorge.fr - username: ${{ secrets.REGISTRY_USER }} - password: ${{ secrets.REGISTRY_PASSWORD }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build Docker Image - env: - BRANCH_NAME: ${{ github.ref_name }} - SHORT_HASH: ${{ github.sha }} - run: | - # Build the image with the commit hash tag - docker build --build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} -t git.phorge.fr/retake/retake.fr:${SHORT_HASH:0:5} . - - # Tag the same image as "latest" - docker tag git.phorge.fr/retake/retake.fr:${SHORT_HASH:0:5} git.phorge.fr/retake/retake.fr:latest \ No newline at end of file + - name: Build and push + uses: docker/build-push-action@v6 + with: + platforms: linux/amd64,linux/arm64 + push: false + tags: git.phorge.fr/retake/retake.fr:${SHORT_HASH:0:5} git.phorge.fr/retake/retake.fr:latest \ No newline at end of file