diff --git a/.github/workflows/build-push-image.yml b/.github/workflows/build-push-image.yml new file mode 100644 index 0000000..6f66e6d --- /dev/null +++ b/.github/workflows/build-push-image.yml @@ -0,0 +1,21 @@ +name: Publish Docker image +on: + release: + types: [published] +jobs: + push_to_registry: + name: Push Docker image to GitHub Packages + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Prepare + run: make prepare + - name: Push to GitHub Packages + uses: docker/build-push-action@v1 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + repository: stackhpc/hyperkube-base + tag_with_ref: true diff --git a/Makefile b/Makefile index 5d09dd4..4f2feaf 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,9 @@ clean: rm -rf cni-bin/ rm -f scripts/iptables-wrapper-installer.sh -build: clean cni-bin/bin scripts/iptables-wrapper-installer.sh +prepare: cni-bin/bin scripts/iptables-wrapper-installer.sh + +build: clean prepare docker build --pull --build-arg ARCH=${ARCH} -t $(IMAGE):$(TAG)-linux-$(ARCH) . push: build