Mirror of https://github.com/roostorg/osprey github.com/roostorg/osprey
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

build and publish coordinator image (#83)

authored by

Chenyu and committed by
GitHub
f3e08db0 f0164353

+86
+86
.github/workflows/publish-coordinator-image.yml
··· 1 + name: Build and Publish Osprey Coordinator Docker Image 2 + 3 + on: 4 + push: 5 + branches: 6 + - main 7 + paths: 8 + - "osprey_coordinator/**" 9 + - "proto/**" 10 + - ".github/workflows/publish-coordinator-image.yml" 11 + pull_request: 12 + branches: 13 + - main 14 + paths: 15 + - "osprey_coordinator/**" 16 + - "proto/**" 17 + - ".github/workflows/publish-coordinator-image.yml" 18 + release: 19 + types: [published] 20 + workflow_dispatch: 21 + 22 + env: 23 + REGISTRY: ghcr.io 24 + IMAGE_NAME: ${{ github.repository }}/osprey-coordinator 25 + 26 + jobs: 27 + build-and-push: 28 + runs-on: ubuntu-24.04 29 + permissions: 30 + contents: read 31 + packages: write 32 + 33 + steps: 34 + - name: Checkout repository 35 + uses: actions/checkout@v4 36 + 37 + - name: Set up Docker Buildx 38 + uses: docker/setup-buildx-action@v3 39 + 40 + - name: Log in to GitHub Container Registry 41 + if: github.event_name != 'pull_request' 42 + uses: docker/login-action@v3 43 + with: 44 + registry: ${{ env.REGISTRY }} 45 + username: ${{ github.actor }} 46 + password: ${{ secrets.GITHUB_TOKEN }} 47 + 48 + - name: Extract metadata (tags, labels) for Docker 49 + id: meta 50 + uses: docker/metadata-action@v5 51 + with: 52 + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 53 + tags: | 54 + type=ref,event=branch 55 + type=ref,event=pr 56 + type=semver,pattern={{version}} 57 + type=semver,pattern={{major}}.{{minor}} 58 + type=semver,pattern={{major}} 59 + type=sha 60 + type=raw,value=latest,enable={{is_default_branch}} 61 + 62 + - name: Build and push Docker image 63 + uses: docker/build-push-action@v5 64 + with: 65 + context: . 66 + file: ./osprey_coordinator/Dockerfile 67 + push: ${{ github.event_name != 'pull_request' }} 68 + tags: ${{ steps.meta.outputs.tags }} 69 + labels: ${{ steps.meta.outputs.labels }} 70 + cache-from: type=gha 71 + cache-to: type=gha,mode=max 72 + platforms: linux/amd64 73 + 74 + - name: Generate build summary 75 + if: github.event_name != 'pull_request' 76 + run: | 77 + echo "## Docker Image Published" >> $GITHUB_STEP_SUMMARY 78 + echo "" >> $GITHUB_STEP_SUMMARY 79 + echo "**Registry:** ${{ env.REGISTRY }}" >> $GITHUB_STEP_SUMMARY 80 + echo "" >> $GITHUB_STEP_SUMMARY 81 + echo "**Image:** ${{ env.IMAGE_NAME }}" >> $GITHUB_STEP_SUMMARY 82 + echo "" >> $GITHUB_STEP_SUMMARY 83 + echo "**Tags:**" >> $GITHUB_STEP_SUMMARY 84 + echo '```' >> $GITHUB_STEP_SUMMARY 85 + echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY 86 + echo '```' >> $GITHUB_STEP_SUMMARY