|
| 1 | +name: Publish ACA-Py Image (Indy) |
| 2 | +run-name: Publish ACA-Py ${{ inputs.tag || github.event.release.tag_name }} Image (Indy ${{ inputs.indy_version || '1.16.0' }}) |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [released] |
| 6 | + |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + indy_version: |
| 10 | + description: 'Indy SDK Version' |
| 11 | + required: true |
| 12 | + default: 1.16.0 |
| 13 | + type: string |
| 14 | + tag: |
| 15 | + description: 'Image tag' |
| 16 | + required: true |
| 17 | + type: string |
| 18 | + |
| 19 | +# Note: |
| 20 | +# - ACA-Py with Indy SDK image builds do not include support for the linux/arm64 platform. |
| 21 | +# - See notes below for details. |
| 22 | + |
| 23 | +env: |
| 24 | + INDY_VERSION: ${{ inputs.indy_version || '1.16.0' }} |
| 25 | + |
| 26 | +jobs: |
| 27 | + publish-image: |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + python-version: ['3.6', '3.9'] |
| 32 | + |
| 33 | + name: Publish ACA-Py Image (Indy) |
| 34 | + runs-on: ubuntu-latest |
| 35 | + steps: |
| 36 | + - name: Checkout Code |
| 37 | + uses: actions/checkout@v3 |
| 38 | + |
| 39 | + - name: Gather image info |
| 40 | + id: info |
| 41 | + run: | |
| 42 | + echo "repo-owner=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_OUTPUT |
| 43 | +
|
| 44 | + - name: Cache Docker layers |
| 45 | + uses: actions/cache@v3 |
| 46 | + with: |
| 47 | + path: /tmp/.buildx-cache |
| 48 | + key: ${{ runner.os }}-buildx-${{ github.sha }} |
| 49 | + restore-keys: | |
| 50 | + ${{ runner.os }}-buildx- |
| 51 | +
|
| 52 | + - name: Set up Docker Buildx |
| 53 | + uses: docker/setup-buildx-action@v2 |
| 54 | + |
| 55 | + - name: Log in to the GitHub Container Registry |
| 56 | + uses: docker/login-action@v2 |
| 57 | + with: |
| 58 | + registry: ghcr.io |
| 59 | + username: ${{ github.repository_owner }} |
| 60 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + |
| 62 | + - name: Setup Image Metadata |
| 63 | + id: meta |
| 64 | + uses: docker/metadata-action@v4 |
| 65 | + with: |
| 66 | + images: | |
| 67 | + ghcr.io/${{ steps.info.outputs.repo-owner }}/aries-cloudagent-python |
| 68 | + tags: | |
| 69 | + type=raw,value=py${{ matrix.python-version }}-indy-${{ env.INDY_VERSION }}-${{ inputs.tag || github.event.release.tag_name }} |
| 70 | +
|
| 71 | + - name: Build and Push Image to ghcr.io |
| 72 | + uses: docker/build-push-action@v3 |
| 73 | + with: |
| 74 | + push: true |
| 75 | + context: . |
| 76 | + file: docker/Dockerfile.indy |
| 77 | + tags: ${{ steps.meta.outputs.tags }} |
| 78 | + labels: ${{ steps.meta.outputs.labels }} |
| 79 | + target: main |
| 80 | + build-args: | |
| 81 | + python_version=${{ matrix.python-version }} |
| 82 | + indy_version=${{ env.INDY_VERSION }} |
| 83 | + acapy_version=${{ inputs.tag || github.event.release.tag_name }} |
| 84 | + cache-from: type=local,src=/tmp/.buildx-cache |
| 85 | + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max |
| 86 | + # Images do not include support for the linux/arm64 platform due to a known issue compiling the postgres plugin |
| 87 | + # - https://github.com/hyperledger/indy-sdk/issues/2445 |
| 88 | + # There is a pending PR to fix this issue here; https://github.com/hyperledger/indy-sdk/pull/2453 |
| 89 | + platforms: linux/amd64,linux/386 |
| 90 | + |
| 91 | + # Temp fix |
| 92 | + # https://github.com/docker/build-push-action/issues/252 |
| 93 | + # https://github.com/moby/buildkit/issues/1896 |
| 94 | + - name: Move cache |
| 95 | + run: | |
| 96 | + rm -rf /tmp/.buildx-cache |
| 97 | + mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
0 commit comments