From c9dbc37da25b693490e16165516fd8692a23f21a Mon Sep 17 00:00:00 2001 From: Nicolas Graf Date: Fri, 9 Jul 2021 15:36:49 +0200 Subject: [PATCH 1/2] Remove DockerHub autobuild --- hooks/build | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 hooks/build diff --git a/hooks/build b/hooks/build deleted file mode 100644 index 6525114..0000000 --- a/hooks/build +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -echo "Build hook running" -IFS=',' read -ra tags <<< "$DOCKER_TAG" -TAG_COMMAND="" - -for tag in "${tags[@]}" -do - TAG_COMMAND="$TAG_COMMAND -t $DOCKER_REPO:$tag" -done - -docker build --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - --build-arg REVISION="$(git rev-parse --short HEAD)" \ - $TAG_COMMAND . From 995ca04e63d000be3e94924b10dc8a475b88fe83 Mon Sep 17 00:00:00 2001 From: Nicolas Graf Date: Fri, 9 Jul 2021 15:47:06 +0200 Subject: [PATCH 2/2] Add GitHub actions autobuild --- .github/workflows/docker-publish.yml | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..a474b3f --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,43 @@ +name: Docker Publish +on: + release: + types: [published] + +jobs: + push: + runs-on: ubuntu-latest + if: github.event_name == 'release' + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Prepare + id: prep + run: | + DOCKER_IMAGE=evotm/evosc + VERSION=${GITHUB_REF#refs/tags/} + TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:latest" + echo ::set-output name=version::${VERSION} + echo ::set-output name=tags::${TAGS} + echo ::set-output name=builddate::$(date -u +'%Y-%m-%dT%H:%M:%SZ') + echo ::set-output name=revision::$(git rev-parse --short HEAD) + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ${{ steps.prep.outputs.tags }} + build-args: | + BUILD_DATE=${{ steps.prep.outputs.builddate }} + REVISION=${{ steps.prep.outputs.revision }} \ No newline at end of file