Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Publish Docker Image

on:
push:
branches: [main]
release:
types: [published]

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.repository == 'finos/git-proxy'
uses: docker/login-action@v3
with:
username: finos
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set Docker Image Tag
id: tags
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "tags=finos/git-proxy:${{ github.ref_name }},finos/git-proxy:latest" >> $GITHUB_OUTPUT
else
echo "tags=finos/git-proxy:main" >> $GITHUB_OUTPUT
fi

- name: Build and Publish Docker Image
if: github.repository == 'finos/git-proxy'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.tags.outputs.tags }}
provenance: true
Loading