diff --git a/.github/workflows/publish-image.yaml b/.github/workflows/publish-image.yaml new file mode 100644 index 0000000..52e306a --- /dev/null +++ b/.github/workflows/publish-image.yaml @@ -0,0 +1,29 @@ +name: "Publish Container Image" + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + publish-image: + runs-on: ubuntu-latest + env: + REGISTRY: ghcr.io/${{github.repository}} + DOCKER_BUILD_ARGS: --push + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v1 + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Expose GitHub Runtime + uses: crazy-max/ghaction-github-runtime@v2 + # buildkit requires $ACTIONS_CACHE_URL and $ACTIONS_RUNTIME_TOKEN for GHA build cache + - name: publish image + run: | + make build-driver diff --git a/Makefile b/Makefile index 64a2395..06d2313 100755 --- a/Makefile +++ b/Makefile @@ -33,7 +33,8 @@ STARTER_IMAGE = ${STARTER_BINARY} EXAMPLE_IMAGE = mfcp-example endif -DOCKER_BUILD_ARGS ?= --load --build-arg STAGINGVERSION=${STAGINGVERSION} +DOCKER_BUILD_ARGS ?= --load +DOCKER_BUILD_ARGS += --build-arg STAGINGVERSION=${STAGINGVERSION} ifneq ("$(shell docker buildx build --help | grep 'provenance')", "") DOCKER_BUILD_ARGS += --provenance=false endif