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
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || github.event_name == 'pull_request'

env:
PUSH_IMAGE: ${{ github.repository == 'EOPF-Explorer/data-pipeline' && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
IMAGE_REGISTRY: ${{ secrets.OVH_HARBOR_REGISTRY || format('ghcr.io/{0}', github.repository_owner) }}

steps:
- name: Checkout code
uses: actions/checkout@v5
Expand All @@ -26,7 +30,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.OVH_HARBOR_REGISTRY }}/eopf-sentinel-zarr-explorer/data-pipeline
images: ${{ env.IMAGE_REGISTRY }}/eopf-sentinel-zarr-explorer/data-pipeline
tags: |
type=sha
type=ref,event=branch
Expand All @@ -38,6 +42,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Log in to OVH Container Registry
if: env.PUSH_IMAGE == 'true'
uses: docker/login-action@v3
with:
registry: ${{ secrets.OVH_HARBOR_REGISTRY }}
Expand All @@ -50,7 +55,7 @@ jobs:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
push: ${{ env.PUSH_IMAGE == 'true' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down