Skip to content

feat: automatic Docker build and upload to Docker Hub #2

feat: automatic Docker build and upload to Docker Hub

feat: automatic Docker build and upload to Docker Hub #2

name: Build and Publish Docker Image
on:
push:
branches: [main]
# For testing
pull_request:
branches: [main]
jobs:
docker-build-publish:
name: Build and Publish Docker Image
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Checkout Repository
uses: actions/checkout@v6
- name: Log in to Docker Hub
# if: github.ref == 'refs/heads/main' && github.repository == 'finos/git-proxy'
uses: docker/login-action@v3
with:
username: finos
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Publish Docker Image
# if: github.ref == 'refs/heads/main' && github.repository == 'finos/git-proxy'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: finos/git-proxy:latest
provenance: true