Separated the Validation and Publishing Workflows (#342) #1
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: Publish Orchestration Engine Image | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'exchange/orchestration-engine-go/**' | |
| - '.github/workflows/orchestration-engine-publish.yml' | |
| tags: | |
| - 'orchestration-engine-v*' | |
| - 'v*' | |
| workflow_dispatch: | |
| env: | |
| # === Service-specific variables === | |
| SERVICE_PATH: 'exchange/orchestration-engine-go' | |
| IMAGE_NAME: ${{ github.repository }}/orchestration-engine | |
| # ================================ | |
| REGISTRY: ghcr.io | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # To check out the code | |
| packages: write # To push images to GHCR | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha,format=long | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| labels: | | |
| org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} | |
| org.opencontainers.image.description=Orchestration Engine service for coordinating data exchange workflows | |
| org.opencontainers.image.licenses=Apache-2.0 | |
| - name: Build and push Docker image | |
| id: build-push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ${{ env.SERVICE_PATH }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| SERVICE_PATH=${{ env.SERVICE_PATH }} | |
| BUILD_VERSION=${{ github.sha }} | |
| BUILD_TIME=${{ github.event.head_commit.timestamp || github.event.repository.pushed_at || '2025-01-01T00:00:00Z' }} | |
| GIT_COMMIT=${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |