|
75 | 75 | steps:
|
76 | 76 | - uses: actions/checkout@v4
|
77 | 77 |
|
| 78 | + - name: Set up containerd |
| 79 | + uses: crazy-max/ghaction-setup-containerd@v3 |
| 80 | + |
| 81 | + - name: Fix containerd socket permissions |
| 82 | + run: | |
| 83 | + sudo chgrp docker /run/containerd/containerd.sock |
| 84 | +
|
78 | 85 | - name: Set up QEMU
|
79 | 86 | uses: docker/setup-qemu-action@v3
|
80 | 87 |
|
@@ -102,15 +109,58 @@ jobs:
|
102 | 109 | shell: bash
|
103 | 110 | working-directory: ./ndc-lambda-sdk
|
104 | 111 |
|
105 |
| - - uses: docker/build-push-action@v6 |
| 112 | + - name: Build docker image |
| 113 | + uses: docker/build-push-action@v6 |
| 114 | + with: |
| 115 | + context: . |
| 116 | + build-args: | |
| 117 | + CONNECTOR_VERSION=${{ steps.get-npm-package-version.outputs.package_version }} |
| 118 | + platforms: linux/amd64,linux/arm64 |
| 119 | + tags: ${{ steps.docker-metadata.outputs.tags }} |
| 120 | + labels: ${{ steps.docker-metadata.outputs.labels }} |
| 121 | + outputs: type=oci,dest=/tmp/image.tar # Export the image to a tar so it can be imported into containerd so gokakashi can scan it |
| 122 | + |
| 123 | + - name: Import docker image into containerd store |
| 124 | + run: | |
| 125 | + ctr images import --base-name ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} --digests --all-platforms /tmp/image.tar |
| 126 | +
|
| 127 | + - name: Get first docker tag for gokakashi |
| 128 | + id: first-docker-tag |
| 129 | + run: | |
| 130 | + FIRST_TAG=$(echo "${{ steps.docker-metadata.outputs.tags }}" | head -n 1) |
| 131 | + echo "First docker tag: $FIRST_TAG" |
| 132 | + echo "tag=$FIRST_TAG" >> $GITHUB_OUTPUT |
| 133 | +
|
| 134 | + - name: Scan docker image with gokakashi |
| 135 | + uses: shinobistack/[email protected] |
| 136 | + with: |
| 137 | + image: ${{ steps.first-docker-tag.outputs.tag }} |
| 138 | + labels: agentKey=${{ github.run_id }} |
| 139 | + policy: ci-platform |
| 140 | + server: https://gokakashi-server.hasura-app.io |
| 141 | + token: ${{ secrets.GOKAKASHI_API_TOKEN }} |
| 142 | + cf_client_id: ${{ secrets.CF_ACCESS_CLIENT_ID }} |
| 143 | + cf_client_secret: ${{ secrets.CF_ACCESS_CLIENT_SECRET }} |
| 144 | + interval: 10 |
| 145 | + retries: 8 |
| 146 | + |
| 147 | + - name: Upload Trivy report as artifact |
| 148 | + uses: actions/upload-artifact@v4 |
| 149 | + with: |
| 150 | + name: trivy-report |
| 151 | + path: /tmp/trivy-report-*.json |
| 152 | + |
| 153 | + - name: Push docker image |
| 154 | + uses: docker/build-push-action@v6 |
| 155 | + if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
106 | 156 | with:
|
107 | 157 | context: .
|
108 | 158 | build-args: |
|
109 | 159 | CONNECTOR_VERSION=${{ steps.get-npm-package-version.outputs.package_version }}
|
110 |
| - push: ${{ startsWith(github.ref, 'refs/tags/v') }} |
111 | 160 | platforms: linux/amd64,linux/arm64
|
112 | 161 | tags: ${{ steps.docker-metadata.outputs.tags }}
|
113 | 162 | labels: ${{ steps.docker-metadata.outputs.labels }}
|
| 163 | + push: true |
114 | 164 |
|
115 | 165 | release-connector:
|
116 | 166 | name: Release connector
|
|
0 commit comments