name: Build and Push Docker Image on: push: branches: - main tags: - "v*" jobs: build: runs-on: prodesk steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Gitea Docker Registry uses: docker/login-action@v3 with: registry: gitea.calahilstudios.com username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Set Docker tags id: docker-tags run: | TAGS="calahilstudios/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest" TAGS="$TAGS calahilstudios/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}" # Add version tag if this is a v* tag push if [[ "${{ github.ref }}" == refs/tags/v* ]]; then TAG_NAME="${{ github.ref_name }}" TAGS="$TAGS calahilstudios/${{ github.repository_owner }}/${{ github.event.repository.name }}:${TAG_NAME}" fi echo "TAGS=$TAGS" >> $GITHUB_ENV - name: Build and push image uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile push: true tags: ${{ env.TAGS }}