feat: automatic Docker build and upload to Docker Hub #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |