|
| 1 | +--- |
| 2 | +name: Build and publish NiFi for signal-processing demo |
| 3 | + |
| 4 | +env: |
| 5 | + IMAGE_NAME: nifi |
| 6 | + IMAGE_VERSION: 1.27.0-postgresql |
| 7 | + REGISTRY_PATH: demos |
| 8 | + DOCKERFILE_PATH: "../demos/signal-processing/Dockerfile-nifi" |
| 9 | + |
| 10 | +on: |
| 11 | + workflow_dispatch: |
| 12 | + push: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + paths: |
| 16 | + - demos/signal-processing/Dockerfile-nifi |
| 17 | + - .github/workflows/dev_nifi.yaml |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + name: Build/Publish ${{ matrix.runner.arch }} Image |
| 22 | + permissions: |
| 23 | + id-token: write |
| 24 | + runs-on: ${{ matrix.runner.name }} |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + runner: |
| 28 | + - {name: "ubuntu-latest", arch: "amd64"} |
| 29 | + - {name: "ubicloud-standard-8-arm", arch: "arm64"} |
| 30 | + steps: |
| 31 | + - name: Checkout Repository |
| 32 | + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 33 | + |
| 34 | + - name: Free Disk Space (Ubuntu) |
| 35 | + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 |
| 36 | + with: |
| 37 | + # This might remove tools that are actually needed, if set to "true" but |
| 38 | + # frees about 6 GB. |
| 39 | + tool-cache: false |
| 40 | + |
| 41 | + # All of these default to true, but feel free to set to "false" if |
| 42 | + # necessary for your workflow. |
| 43 | + android: true |
| 44 | + dotnet: true |
| 45 | + haskell: true |
| 46 | + large-packages: true |
| 47 | + docker-images: true |
| 48 | + swap-storage: true |
| 49 | + |
| 50 | + - name: Setup Docker Buildx |
| 51 | + uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 |
| 52 | + |
| 53 | + - name: Building ${{ env.IMAGE_NAME }} |
| 54 | + shell: bash |
| 55 | + run: echo ${{ env.IMAGE_NAME }} |
| 56 | + |
| 57 | + - name: Build image |
| 58 | + env: |
| 59 | + IMAGE_REPOSITORY: ${{ env.IMAGE_NAME }} |
| 60 | + shell: bash |
| 61 | + run: | |
| 62 | + set -euo pipefail |
| 63 | + IMAGE_ARCH="$(uname -m | sed -e 's#x86_64#amd64#' | sed -e 's#aarch64#arm64#')" |
| 64 | +
|
| 65 | + docker buildx build -f ${{ DOCKERFILE_PATH }} --platform linux/${IMAGE_ARCH} --tag registry-placeholder/${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }} . |
| 66 | +
|
| 67 | + echo "IMAGE_ARCH=$IMAGE_ARCH" >> $GITHUB_ENV |
| 68 | +
|
| 69 | + - name: Publish Container Image on docker.stackable.tech |
| 70 | + uses: stackabletech/actions/publish-image |
| 71 | + with: |
| 72 | + image-registry-uri: docker.stackable.tech |
| 73 | + image-registry-username: github |
| 74 | + image-registry-password: ${{ secrets.NEXUS_PASSWORD }} |
| 75 | + image-repository: ${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }} |
| 76 | + image-manifest-tag: ${{ env.IMAGE_VERSION }}-${{ IMAGE_ARCH }} |
| 77 | + source-image-uri: registry-placeholder/${{ env.PRODUCT_NAME }}:${{ env.IMAGE_VERSION }} |
| 78 | + |
| 79 | + - name: Publish Container Image on oci.stackable.tech |
| 80 | + uses: stackabletech/actions/publish-image |
| 81 | + with: |
| 82 | + image-registry-uri: oci.stackable.tech |
| 83 | + image-registry-username: robot$sdp+github-action-build |
| 84 | + image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} |
| 85 | + image-repository: ${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }} |
| 86 | + image-manifest-tag: ${{ env.IMAGE_VERSION }}-${{ IMAGE_ARCH }} |
| 87 | + source-image-uri: registry-placeholder/${{ env.PRODUCT_NAME }}:${{ env.IMAGE_VERSION }} |
| 88 | + |
| 89 | + publish_manifests: |
| 90 | + name: Build/Publish Manifest |
| 91 | + needs: [build] |
| 92 | + permissions: |
| 93 | + id-token: write |
| 94 | + runs-on: ubuntu-latest |
| 95 | + steps: |
| 96 | + - name: Checkout Repository |
| 97 | + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 98 | + |
| 99 | + - name: Publish and Sign Image Index Manifest to docker.stackable.tech |
| 100 | + uses: stackabletech/actions/publish-index-manifest |
| 101 | + with: |
| 102 | + image-registry-uri: docker.stackable.tech |
| 103 | + image-registry-username: github |
| 104 | + image-registry-password: ${{ secrets.NEXUS_PASSWORD }} |
| 105 | + image-repository: ${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }} |
| 106 | + image-index-manifest-tag: ${{ env.IMAGE_VERSION }} |
| 107 | + |
| 108 | + - name: Publish and Sign Image Index Manifest to oci.stackable.tech |
| 109 | + uses: stackabletech/actions/publish-index-manifest |
| 110 | + with: |
| 111 | + image-registry-uri: oci.stackable.tech |
| 112 | + image-registry-username: robot$sdp+github-action-build |
| 113 | + image-registry-password: ${{ secrets.HARBOR_ROBOT_SDP_GITHUB_ACTION_BUILD_SECRET }} |
| 114 | + image-repository: ${{ env.REGISTRY_PATH }}/${{ env.IMAGE_NAME }} |
| 115 | + image-index-manifest-tag: ${{ env.IMAGE_VERSION }} |
0 commit comments