Publish ACA-Py 1.4.0 Image #112
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 ACA-Py Image | |
| run-name: Publish ACA-Py ${{ inputs.tag || github.event.release.tag_name }} Image | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: Image tag | |
| required: true | |
| type: string | |
| ref: | |
| description: Optional - The branch, tag or SHA to checkout. | |
| required: false | |
| type: string | |
| workflow_call: | |
| inputs: | |
| tag: | |
| required: true | |
| type: string | |
| ref: | |
| required: false | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-image: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12"] | |
| arch: ["amd64", "arm64"] | |
| include: | |
| - arch: amd64 | |
| runs-on: ubuntu-24.04 | |
| - arch: arm64 | |
| runs-on: ubuntu-24.04-arm | |
| name: Build ACA-Py Image | |
| runs-on: ${{ matrix.runs-on }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{ inputs.ref || '' }} | |
| persist-credentials: false | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| with: | |
| cache-binary: false | |
| install: true | |
| version: latest | |
| - name: Build and Cache Image | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 | |
| with: | |
| push: false | |
| context: . | |
| file: docker/Dockerfile | |
| build-args: | | |
| python_version=${{ matrix.python-version }} | |
| acapy_version=${{ inputs.tag || github.event.release.tag_name }} | |
| cache-from: type=gha,scope=acapy-agent-${{ matrix.arch }} | |
| cache-to: type=gha,scope=acapy-agent-${{ matrix.arch }},mode=max | |
| platforms: linux/${{ matrix.arch }} | |
| publish-images: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.12"] | |
| image-type: ["standard", "bbs"] | |
| include: | |
| - image-type: standard | |
| image-name: acapy-agent | |
| # linux/386 platform support has been disabled pending a permanent fix for https://github.com/openwallet-foundation/acapy/issues/2124 | |
| # platforms: linux/amd64,linux/arm64,linux/386 | |
| platforms: linux/amd64,linux/arm64 | |
| acapy-reqs: "" | |
| - image-type: bbs | |
| image-name: acapy-agent-bbs | |
| # Because of BBS, only linux/amd64 is supported for the extended image | |
| # https://github.com/openwallet-foundation/acapy/issues/2124#issuecomment-2293569659 | |
| platforms: linux/amd64 | |
| acapy-reqs: "[askar,bbs,didcommv2]" | |
| name: Publish ACA-Py ${{ matrix.image-type == 'bbs' && 'BBS ' || '' }} Image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| needs: build-image | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| ref: ${{ inputs.ref || '' }} | |
| persist-credentials: false | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 | |
| with: | |
| cache-binary: false | |
| install: true | |
| version: latest | |
| - name: Log in to the GitHub Container Registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Ensure the repo owner is lowercase for the image name | |
| - name: Lowercase Repo Owner | |
| id: lower | |
| run: echo "owner=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_OUTPUT | |
| - name: Setup Image Metadata | |
| id: meta | |
| uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0 | |
| with: | |
| images: | | |
| ghcr.io/${{ steps.lower.outputs.owner }}/${{ matrix.image-name }} | |
| tags: | | |
| type=raw,value=py${{ matrix.python-version }}-${{ inputs.tag || github.event.release.tag_name }} | |
| - name: Publish Image to GHCR.io | |
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 | |
| with: | |
| push: true | |
| context: . | |
| file: docker/Dockerfile | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| python_version=${{ matrix.python-version }} | |
| acapy_version=${{ inputs.tag || github.event.release.tag_name }} | |
| ${{ matrix.image-type == 'bbs' && 'acapy_name=acapy-agent-bbs' || '' }} | |
| ${{ matrix.acapy-reqs != '' && format('acapy_reqs={0}', matrix.acapy-reqs) || '' }} | |
| cache-from: | | |
| ${{ matrix.image-type == 'standard' && 'type=gha,scope=acapy-agent-arm64' || '' }} | |
| ${{ matrix.image-type == 'standard' && 'type=gha,scope=acapy-agent-amd64' || '' }} | |
| ${{ matrix.image-type == 'bbs' && 'type=gha,scope=acapy-agent-bbs' || ''}} | |
| cache-to: ${{ matrix.image-type == 'bbs' && 'type=gha,scope=acapy-agent-bbs,mode=max' || '' }} | |
| platforms: ${{ matrix.platforms }} |