|
| 1 | +name: Build-Publish |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + branches: |
| 8 | + - test-image |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +permissions: {} |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-and-push: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + timeout-minutes: 30 |
| 17 | + permissions: |
| 18 | + contents: read |
| 19 | + packages: write |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout repository |
| 23 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 24 | + |
| 25 | + - name: Install uv |
| 26 | + uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6 |
| 27 | + |
| 28 | + - name: Build protobufs |
| 29 | + # Adaptation of the proto-build script for Github runners |
| 30 | + run: | |
| 31 | + uv sync --group proto |
| 32 | + git clone https://github.com/cetanu/envoy_data_plane.git ../envoy_data_plane |
| 33 | + cd ../envoy_data_plane |
| 34 | + git checkout 86181df8ddb05f1d07994e58374fb93139d2bb70 |
| 35 | + python build.py |
| 36 | + cd - |
| 37 | + rm -rf src/envoy |
| 38 | + cp -r ../envoy_data_plane/src/envoy_data_plane_pb2/envoy src/ |
| 39 | + git clone https://github.com/cncf/xds.git ../xds |
| 40 | + rm -rf src/xds src/validate src/udpa |
| 41 | + cp -rf ../xds/python/xds ../xds/python/validate ../xds/python/udpa src/ |
| 42 | +
|
| 43 | + - name: Set up QEMU |
| 44 | + uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4 |
| 45 | + |
| 46 | + - name: Set up Docker Buildx |
| 47 | + uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4 |
| 48 | + |
| 49 | + - name: Log in to ghcr.io |
| 50 | + uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4 |
| 51 | + with: |
| 52 | + registry: ghcr.io |
| 53 | + username: ${{ github.actor }} |
| 54 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + |
| 56 | + - name: Extract Docker metadata |
| 57 | + id: meta |
| 58 | + uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6 |
| 59 | + with: |
| 60 | + images: ghcr.io/${{ github.repository }}/plugins-adapter |
| 61 | + tags: | |
| 62 | + type=ref,event=tag |
| 63 | + type=raw,value=latest,enable=${{ github.ref_type == 'tag' }} |
| 64 | +
|
| 65 | + # Focus on nemocheck plugin in image for now |
| 66 | + - name: Build and push |
| 67 | + uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7 |
| 68 | + with: |
| 69 | + context: . |
| 70 | + push: true |
| 71 | + platforms: linux/amd64,linux/arm64 |
| 72 | + build-args: PLUGIN_DEPS=nemocheck |
| 73 | + tags: ${{ steps.meta.outputs.tags }} |
| 74 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments