From 525f04b492fc04d29967ac3b25e423a37dcf2645 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 7 Dec 2020 13:40:53 +0100 Subject: [PATCH] Publish image on master merged changes As we are pretty much committed to github actions, we should probably rely on it to push the images at each commit merged on the master branch. --- .github/workflows/on-master-push.yaml | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/on-master-push.yaml diff --git a/.github/workflows/on-master-push.yaml b/.github/workflows/on-master-push.yaml new file mode 100644 index 0000000..2d5a826 --- /dev/null +++ b/.github/workflows/on-master-push.yaml @@ -0,0 +1,38 @@ +# We publish every merged commit in the form of an image +# named kured:- +name: Push image of latest master +on: + push: + branches: + - master +jobs: + tag-scan-and-push-final-image: + name: "Build, scan, and publish tagged image" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - name: Find go version + run: | + GO_VERSION=$(awk '/^go/ {print $2};' go.mod) + echo "::set-output name=version::${GO_VERSION}" + id: awk_gomod + + - name: Ensure go version + uses: actions/setup-go@v2 + with: + go-version: "${{ steps.awk_gomod.outputs.version }}" + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME_WEAVEWORKSKUREDCI }} + password: ${{ secrets.DOCKERHUB_TOKEN_WEAVEWORKSKUREDCI }} + + - name: Build image + run: | + make DH_ORG="${{ github.repository_owner }}" image + + - name: Publish image + run: | + make DH_ORG="${{ github.repository_owner }}" publish-image