diff --git a/.gitea/workflows/publish-docker.yml b/.gitea/workflows/publish-docker.yml new file mode 100644 index 0000000..eb42329 --- /dev/null +++ b/.gitea/workflows/publish-docker.yml @@ -0,0 +1,47 @@ +name: Publish Docker image + +on: + push: + tags: + - 'OFDLV*' + +jobs: + docker: + name: Build and push Docker image to Gitea Registry + runs-on: ubuntu-latest + + steps: + - name: Extract tag and version + id: version + run: | + TAG="${{ gitea.ref##refs/tags/ }}" + VERSION="${TAG#OFDLV}" + echo "Tag: $TAG" + echo "Version: $VERSION" + echo "tag=$TAG" >> "$GITEA_OUTPUT" + echo "version=$VERSION" >> "$GITEA_OUTPUT" + + - name: Checkout code + 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: git.ofdl.tools + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + git.ofdl.tools/sim0n00ps/of-dl:latest + git.ofdl.tools/sim0n00ps/of-dl:${{ steps.version.outputs.version }} + build-args: | + VERSION=${{ steps.version.outputs.version }} \ No newline at end of file