From 584680e7e483bc2cc4227ec1af83ea7f8b195d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Fri, 6 Mar 2020 13:10:59 +0100 Subject: [PATCH] Follow up - 0798e7d47ed2505ea43dccdb9c1ef867d700f720 - moved from circle ci to github actions. Extract REPO_USER to GitHub secret to make it reusable in Zammad Docker Omnibus and Compose repository. --- .github/docker-image-build.sh | 3 +-- .github/workflows/build-docker-compose-images.yaml | 5 +++-- .github/workflows/build-docker-image.yaml | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/docker-image-build.sh b/.github/docker-image-build.sh index 3dc0f5b1b..a57e49575 100755 --- a/.github/docker-image-build.sh +++ b/.github/docker-image-build.sh @@ -7,7 +7,6 @@ set -o pipefail DOCKER_REGISTRY="index.docker.io" REPO_ROOT="$(git rev-parse --show-toplevel)" -REPO_USER="zammad" ZAMMAD_VERSION="$(git describe --tags | sed -e 's/-[a-z0-9]\{8,\}.*//g')" # dockerhub auth @@ -21,7 +20,7 @@ cd "${REPO_ROOT}/${DOCKER_GITHUB_REPOSITORY}" # shellcheck disable=SC2153 for DOCKER_IMAGE in ${DOCKER_IMAGES}; do - echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${ZAMMAD_VERSION} for DockerHubs ${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE} repo" + echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${ZAMMAD_VERSION} for DockerHubs ${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY} repo" if [ "${DOCKER_REPOSITORY}" == "zammad-docker-compose" ]; then docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-latest" -t "${DOCKER_REGISTRY}/${REPO_USER}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}" -f "containers/${DOCKER_IMAGE}/Dockerfile" . diff --git a/.github/workflows/build-docker-compose-images.yaml b/.github/workflows/build-docker-compose-images.yaml index a673fc1bb..5959dbcc3 100644 --- a/.github/workflows/build-docker-compose-images.yaml +++ b/.github/workflows/build-docker-compose-images.yaml @@ -2,17 +2,18 @@ name: build-docker-compose-images on: push: - branches: [stable] + branches: [stable**] jobs: build-docker-compose-images: runs-on: ubuntu-latest env: + DOCKER_GITHUB_REPOSITORY: "zammad-docker-compose" DOCKER_IMAGES: "zammad zammad-elasticsearch zammad-postgresql" DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKER_REPOSITORY: "zammad-docker-compose" DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_GITHUB_REPOSITORY: "zammad-docker-compose" + REPO_USER: ${{ secrets.REPO_USER }} steps: - name: Checkout code uses: actions/checkout@master diff --git a/.github/workflows/build-docker-image.yaml b/.github/workflows/build-docker-image.yaml index 0d9c76254..9e9cf9086 100644 --- a/.github/workflows/build-docker-image.yaml +++ b/.github/workflows/build-docker-image.yaml @@ -8,11 +8,12 @@ jobs: build-docker-image: runs-on: ubuntu-latest env: + DOCKER_GITHUB_REPOSITORY: "zammad-docker" DOCKER_IMAGES: "zammad" DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKER_REPOSITORY: "zammad" DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_GITHUB_REPOSITORY: "zammad-docker" + REPO_USER: ${{ secrets.REPO_USER }} steps: - name: Checkout code uses: actions/checkout@master