DCP-AI v2.7.0 #3
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: Publish Docker Images | |
| # Builds the four DCP-AI services (verification, anchor, transparency-log, | |
| # revocation) and pushes them to GitHub Container Registry (ghcr.io). | |
| # Anyone can then run them with: | |
| # docker run -p 3000:3000 ghcr.io/dcp-ai-protocol/dcp-ai/verification:latest | |
| # | |
| # Triggers: | |
| # - Every release (tag v*) | |
| # - Push to main that touches the service code or the Dockerfile | |
| # - Manual dispatch | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'server/**' | |
| - 'services/**' | |
| - 'lib/**' | |
| - 'tools/**' | |
| - 'schemas/**' | |
| - 'docker/Dockerfile' | |
| - '.github/workflows/publish-docker.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_OWNER: dcp-ai-protocol/dcp-ai | |
| jobs: | |
| build-and-push: | |
| name: ${{ matrix.service }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| service: | |
| - verification | |
| - anchor | |
| - transparency-log | |
| - revocation | |
| steps: | |
| - 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 tag metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_OWNER }}/${{ matrix.service }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=ref,event=branch | |
| type=ref,event=tag | |
| type=sha,prefix=sha-,format=short | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| - name: Build & push ${{ matrix.service }} | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./docker/Dockerfile | |
| target: ${{ matrix.service }} | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=${{ matrix.service }} | |
| cache-to: type=gha,scope=${{ matrix.service }},mode=max |