From 961c30ccdbdfd210fe8e9b1f3d3c4222fe4a4ae2 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 12 Sep 2021 20:29:19 +0000 Subject: [PATCH 1/5] Refactor (ci): Remove .github/workflows/ci-release and use only ci-master-pr and CalVer-based workflow --- .github/release-drafter.yml | 52 + .github/workflows/ci-master-pr.yml | 5187 ++++++++++++++--- .github/workflows/ci-release.yml | 2395 -------- generate/definitions/FILES.ps1 | 3 +- .../templates/.github/release-drafter.yml.ps1 | 54 + .../.github/workflows/ci-master-pr.yml.ps1 | 238 +- .../.github/workflows/ci-release.yml.ps1 | 90 - 7 files changed, 4744 insertions(+), 3275 deletions(-) create mode 100644 .github/release-drafter.yml delete mode 100644 .github/workflows/ci-release.yml create mode 100644 generate/templates/.github/release-drafter.yml.ps1 delete mode 100644 generate/templates/.github/workflows/ci-release.yml.ps1 diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..cd59642 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,52 @@ +# For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. +name-template: '$RESOLVED_VERSION 🌈' +tag-template: '$RESOLVED_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🖊️ Refactors' + labels: + - 'refactor' + - title: '👗 Style' + labels: + - 'style' + - title: '📝 Documentation' + labels: + - 'docs' + - 'documentation' + - title: '🧰 Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +version-resolver: + major: + labels: + # - 'major' + - 'breaking' + minor: + labels: + # - 'minor' + - 'feature' + - 'enhancement' + - 'refactor' + patch: + labels: + # - 'patch' + - 'fix' + - 'bugfix' + - 'bug' + - 'style' + - 'docs' + - 'documentation' + default: patch +sort-by: title +template: | + ## Changes + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 7081748..3996ce5 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -4,19 +4,22 @@ on: push: branches: - master + - release # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. pull_request: branches: - master - jobs: + build-3-12-curl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-curl # VARIANT_TAG_WITH_REF: 3.12-curl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-curl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -29,45 +32,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-12-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-git # VARIANT_TAG_WITH_REF: 3.12-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -80,45 +162,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-12-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-jq # VARIANT_TAG_WITH_REF: 3.12-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -131,45 +292,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-12-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-ssh # VARIANT_TAG_WITH_REF: 3.12-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -182,45 +422,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-12-curl-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-curl-git # VARIANT_TAG_WITH_REF: 3.12-curl-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-curl-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -233,45 +552,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-12-curl-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-curl-jq # VARIANT_TAG_WITH_REF: 3.12-curl-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-curl-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -284,45 +682,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-12-curl-git-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-curl-git-jq # VARIANT_TAG_WITH_REF: 3.12-curl-git-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-curl-git-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -335,45 +812,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-12-curl-git-jq-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-curl-git-jq-ssh # VARIANT_TAG_WITH_REF: 3.12-curl-git-jq-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-curl-git-jq-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -386,45 +942,125 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + ${{ github.repository }}:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-12-mysqlclient-openssl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.12-mysqlclient-openssl # VARIANT_TAG_WITH_REF: 3.12-mysqlclient-openssl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.12-mysqlclient-openssl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -437,45 +1073,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-11-curl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-curl # VARIANT_TAG_WITH_REF: 3.11-curl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-curl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -488,45 +1203,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-11-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-git # VARIANT_TAG_WITH_REF: 3.11-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -539,45 +1333,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-11-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-jq # VARIANT_TAG_WITH_REF: 3.11-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -590,45 +1463,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-11-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-ssh # VARIANT_TAG_WITH_REF: 3.11-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -641,45 +1593,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-curl-git: - runs-on: ubuntu-18.04 + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + + - name: Clean-up + run: docker logout + if: always() + + build-3-11-curl-git: + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-curl-git # VARIANT_TAG_WITH_REF: 3.11-curl-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-curl-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -692,45 +1723,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-11-curl-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-curl-jq # VARIANT_TAG_WITH_REF: 3.11-curl-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-curl-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -743,45 +1853,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-11-curl-git-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-curl-git-jq # VARIANT_TAG_WITH_REF: 3.11-curl-git-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-curl-git-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -794,45 +1983,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-11-curl-git-jq-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-curl-git-jq-ssh # VARIANT_TAG_WITH_REF: 3.11-curl-git-jq-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-curl-git-jq-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -845,45 +2113,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-11-mysqlclient-openssl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.11-mysqlclient-openssl # VARIANT_TAG_WITH_REF: 3.11-mysqlclient-openssl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.11-mysqlclient-openssl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -896,45 +2243,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-curl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-curl # VARIANT_TAG_WITH_REF: 3.10-curl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-curl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -947,45 +2373,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-git # VARIANT_TAG_WITH_REF: 3.10-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -998,45 +2503,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-jq # VARIANT_TAG_WITH_REF: 3.10-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1049,45 +2633,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-ssh # VARIANT_TAG_WITH_REF: 3.10-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1100,45 +2763,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-curl-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-curl-git # VARIANT_TAG_WITH_REF: 3.10-curl-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-curl-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1151,45 +2893,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-curl-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-curl-jq # VARIANT_TAG_WITH_REF: 3.10-curl-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-curl-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1202,45 +3023,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-curl-git-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-curl-git-jq # VARIANT_TAG_WITH_REF: 3.10-curl-git-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-curl-git-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1253,45 +3153,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-curl-git-jq-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-curl-git-jq-ssh # VARIANT_TAG_WITH_REF: 3.10-curl-git-jq-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-curl-git-jq-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1304,45 +3283,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-10-mysqlclient-openssl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.10-mysqlclient-openssl # VARIANT_TAG_WITH_REF: 3.10-mysqlclient-openssl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.10-mysqlclient-openssl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1355,45 +3413,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-curl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-curl # VARIANT_TAG_WITH_REF: 3.9-curl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-curl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1406,45 +3543,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-git # VARIANT_TAG_WITH_REF: 3.9-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1457,45 +3673,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-jq # VARIANT_TAG_WITH_REF: 3.9-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1508,45 +3803,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-ssh # VARIANT_TAG_WITH_REF: 3.9-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1559,45 +3933,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-curl-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-curl-git # VARIANT_TAG_WITH_REF: 3.9-curl-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-curl-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1610,45 +4063,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-curl-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-curl-jq # VARIANT_TAG_WITH_REF: 3.9-curl-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-curl-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1661,45 +4193,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-curl-git-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-curl-git-jq # VARIANT_TAG_WITH_REF: 3.9-curl-git-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-curl-git-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1712,45 +4323,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-curl-git-jq-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-curl-git-jq-ssh # VARIANT_TAG_WITH_REF: 3.9-curl-git-jq-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-curl-git-jq-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1763,45 +4453,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-9-mysqlclient-openssl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.9-mysqlclient-openssl # VARIANT_TAG_WITH_REF: 3.9-mysqlclient-openssl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.9-mysqlclient-openssl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1814,45 +4583,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-curl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-curl # VARIANT_TAG_WITH_REF: 3.8-curl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-curl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1865,45 +4713,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-git # VARIANT_TAG_WITH_REF: 3.8-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1916,45 +4843,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-jq # VARIANT_TAG_WITH_REF: 3.8-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -1967,45 +4973,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-ssh # VARIANT_TAG_WITH_REF: 3.8-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2018,45 +5103,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-curl-git: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-curl-git # VARIANT_TAG_WITH_REF: 3.8-curl-git-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-curl-git steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2069,45 +5233,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-curl-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-curl-jq # VARIANT_TAG_WITH_REF: 3.8-curl-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-curl-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2120,45 +5363,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-curl-git-jq: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-curl-git-jq # VARIANT_TAG_WITH_REF: 3.8-curl-git-jq-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-curl-git-jq steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2171,45 +5493,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-curl-git-jq-ssh: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-curl-git-jq-ssh # VARIANT_TAG_WITH_REF: 3.8-curl-git-jq-ssh-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-curl-git-jq-ssh steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2222,45 +5623,124 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() + build-3-8-mysqlclient-openssl: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: 3.8-mysqlclient-openssl # VARIANT_TAG_WITH_REF: 3.8-mysqlclient-openssl-${GITHUB_REF} VARIANT_BUILD_DIR: variants/3.8-mysqlclient-openssl steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -2273,34 +5753,199 @@ jobs: pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout - if: always() \ No newline at end of file + if: always() + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + converge-master-and-release-branches: + needs: [build-3-12-curl, build-3-12-git, build-3-12-jq, build-3-12-ssh, build-3-12-curl-git, build-3-12-curl-jq, build-3-12-curl-git-jq, build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl, build-3-11-git, build-3-11-jq, build-3-11-ssh, build-3-11-curl-git, build-3-11-curl-jq, build-3-11-curl-git-jq, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl, build-3-10-git, build-3-10-jq, build-3-10-ssh, build-3-10-curl-git, build-3-10-curl-jq, build-3-10-curl-git-jq, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl, build-3-9-git, build-3-9-jq, build-3-9-ssh, build-3-9-curl-git, build-3-9-curl-jq, build-3-9-curl-git-jq, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl, build-3-8-git, build-3-8-jq, build-3-8-ssh, build-3-8-curl-git, build-3-8-curl-jq, build-3-8-curl-git-jq, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl] + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Merge release into master (fast-forward) + run: | + git checkout master + git merge release + git push origin master + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + resolve-release-tag: + runs-on: ubuntu-latest + outputs: + TAG: ${{ steps.resolve-release-tag.outputs.TAG }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Resolve release tag + id: resolve-release-tag + run: | + set +e + # E.g. 20210402 + TODAYS_DATE=$( date -u '+%Y%m%d' ) + # Is this the first tag for this date? + TODAYS_DATE_TAGS=$( git tag --list | grep "^$TODAYS_DATE" ) + TAG= + if [ -z "$TODAYS_DATE_TAGS" ]; then + # E.g. 20210402.0.0 + TAG="$TODAYS_DATE.0.0" # Send this to stdout + else + # E.g. if there are 20210402.0.0, 20210402.0.1, 20210402.0.2, this returns 2 + VERSION_MINOR_LATEST=$( echo "$TODAYS_DATE_TAGS" | cut -d '.' -f 3 | sort -nr | head -n1 ) + # Minor version + VERSION_MINOR=$( expr "$VERSION_MINOR_LATEST" + 1 ) + # E.g. 20210402.0.3 + TAG="$TODAYS_DATE.0.$VERSION_MINOR" # Send this to stdout + fi + echo "TODAYS_DATE: $TODAYS_DATE" + echo "TODAYS_DATE_TAGS: $TODAYS_DATE_TAGS" + echo "TAG: $TAG" + echo "::set-output name=TAG::$TAG" + - name: Print outputs + run: echo ${{ steps.resolve-release-tag.outputs.TAG }} + + update-draft-release: + needs: [build-3-12-curl, build-3-12-git, build-3-12-jq, build-3-12-ssh, build-3-12-curl-git, build-3-12-curl-jq, build-3-12-curl-git-jq, build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl, build-3-11-git, build-3-11-jq, build-3-11-ssh, build-3-11-curl-git, build-3-11-curl-jq, build-3-11-curl-git-jq, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl, build-3-10-git, build-3-10-jq, build-3-10-ssh, build-3-10-curl-git, build-3-10-curl-jq, build-3-10-curl-git-jq, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl, build-3-9-git, build-3-9-jq, build-3-9-ssh, build-3-9-curl-git, build-3-9-curl-jq, build-3-9-curl-git-jq, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl, build-3-8-git, build-3-8-jq, build-3-8-ssh, build-3-8-curl-git, build-3-8-curl-jq, build-3-8-curl-git-jq, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl, resolve-release-tag] + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Print inputs + run: echo ${{ needs.resolve-release-tag.outputs.TAG }} + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + publish: false + name: ${{ needs.resolve-release-tag.outputs.TAG }} + tag: ${{ needs.resolve-release-tag.outputs.TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish-draft-release: + needs: [build-3-12-curl, build-3-12-git, build-3-12-jq, build-3-12-ssh, build-3-12-curl-git, build-3-12-curl-jq, build-3-12-curl-git-jq, build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl, build-3-11-git, build-3-11-jq, build-3-11-ssh, build-3-11-curl-git, build-3-11-curl-jq, build-3-11-curl-git-jq, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl, build-3-10-git, build-3-10-jq, build-3-10-ssh, build-3-10-curl-git, build-3-10-curl-jq, build-3-10-curl-git-jq, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl, build-3-9-git, build-3-9-jq, build-3-9-ssh, build-3-9-curl-git, build-3-9-curl-jq, build-3-9-curl-git-jq, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl, build-3-8-git, build-3-8-jq, build-3-8-ssh, build-3-8-curl-git, build-3-8-curl-jq, build-3-8-curl-git-jq, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl, converge-master-and-release-branches, resolve-release-tag] + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + publish: true + name: ${{ needs.resolve-release-tag.outputs.TAG }} + tag: ${{ needs.resolve-release-tag.outputs.TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml deleted file mode 100644 index b88bf89..0000000 --- a/.github/workflows/ci-release.yml +++ /dev/null @@ -1,2395 +0,0 @@ -name: ci-release - -on: - push: - branches: - - release - -jobs: - build-3-12-curl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-curl - # VARIANT_TAG_WITH_REF: 3.12-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-12-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-git - # VARIANT_TAG_WITH_REF: 3.12-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-12-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-jq - # VARIANT_TAG_WITH_REF: 3.12-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-12-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-ssh - # VARIANT_TAG_WITH_REF: 3.12-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-12-curl-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-curl-git - # VARIANT_TAG_WITH_REF: 3.12-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-12-curl-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-curl-jq - # VARIANT_TAG_WITH_REF: 3.12-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-12-curl-git-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.12-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl-git-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-12-curl-git-jq-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.12-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl-git-jq-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:latest" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:latest" - - name: Clean-up - run: docker logout - if: always() - build-3-12-mysqlclient-openssl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.12-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.12-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-mysqlclient-openssl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-curl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-curl - # VARIANT_TAG_WITH_REF: 3.11-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-git - # VARIANT_TAG_WITH_REF: 3.11-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-jq - # VARIANT_TAG_WITH_REF: 3.11-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-ssh - # VARIANT_TAG_WITH_REF: 3.11-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-curl-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-curl-git - # VARIANT_TAG_WITH_REF: 3.11-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-curl-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-curl-jq - # VARIANT_TAG_WITH_REF: 3.11-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-curl-git-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.11-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl-git-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-curl-git-jq-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.11-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl-git-jq-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-11-mysqlclient-openssl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.11-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.11-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-mysqlclient-openssl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-curl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-curl - # VARIANT_TAG_WITH_REF: 3.10-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-git - # VARIANT_TAG_WITH_REF: 3.10-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-jq - # VARIANT_TAG_WITH_REF: 3.10-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-ssh - # VARIANT_TAG_WITH_REF: 3.10-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-curl-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-curl-git - # VARIANT_TAG_WITH_REF: 3.10-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-curl-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-curl-jq - # VARIANT_TAG_WITH_REF: 3.10-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-curl-git-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.10-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl-git-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-curl-git-jq-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.10-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl-git-jq-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-10-mysqlclient-openssl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.10-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.10-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-mysqlclient-openssl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-curl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-curl - # VARIANT_TAG_WITH_REF: 3.9-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-git - # VARIANT_TAG_WITH_REF: 3.9-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-jq - # VARIANT_TAG_WITH_REF: 3.9-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-ssh - # VARIANT_TAG_WITH_REF: 3.9-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-curl-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-curl-git - # VARIANT_TAG_WITH_REF: 3.9-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-curl-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-curl-jq - # VARIANT_TAG_WITH_REF: 3.9-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-curl-git-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.9-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl-git-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-curl-git-jq-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.9-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl-git-jq-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-9-mysqlclient-openssl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.9-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.9-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-mysqlclient-openssl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-curl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-curl - # VARIANT_TAG_WITH_REF: 3.8-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-git - # VARIANT_TAG_WITH_REF: 3.8-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-jq - # VARIANT_TAG_WITH_REF: 3.8-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-ssh - # VARIANT_TAG_WITH_REF: 3.8-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-curl-git: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-curl-git - # VARIANT_TAG_WITH_REF: 3.8-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl-git - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-curl-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-curl-jq - # VARIANT_TAG_WITH_REF: 3.8-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-curl-git-jq: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.8-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl-git-jq - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-curl-git-jq-ssh: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.8-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl-git-jq-ssh - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() - build-3-8-mysqlclient-openssl: - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: 3.8-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.8-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-mysqlclient-openssl - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - - name: Clean-up - run: docker logout - if: always() \ No newline at end of file diff --git a/generate/definitions/FILES.ps1 b/generate/definitions/FILES.ps1 index a8ad32c..fc70558 100644 --- a/generate/definitions/FILES.ps1 +++ b/generate/definitions/FILES.ps1 @@ -1,7 +1,8 @@ # Files' definition $FILES = @( '.github/workflows/ci-master-pr.yml' - '.github/workflows/ci-release.yml' + # '.github/workflows/ci-release.yml' + '.github/release-drafter.yml' # '.gitlab-ci.yml' 'README.md' ) diff --git a/generate/templates/.github/release-drafter.yml.ps1 b/generate/templates/.github/release-drafter.yml.ps1 new file mode 100644 index 0000000..9c9c5ca --- /dev/null +++ b/generate/templates/.github/release-drafter.yml.ps1 @@ -0,0 +1,54 @@ +@' +# For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. +name-template: '$RESOLVED_VERSION 🌈' +tag-template: '$RESOLVED_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🖊️ Refactors' + labels: + - 'refactor' + - title: '👗 Style' + labels: + - 'style' + - title: '📝 Documentation' + labels: + - 'docs' + - 'documentation' + - title: '🧰 Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +version-resolver: + major: + labels: + # - 'major' + - 'breaking' + minor: + labels: + # - 'minor' + - 'feature' + - 'enhancement' + - 'refactor' + patch: + labels: + # - 'patch' + - 'fix' + - 'bugfix' + - 'bug' + - 'style' + - 'docs' + - 'documentation' + default: patch +sort-by: title +template: | + ## Changes + + $CHANGES +'@ diff --git a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 index 5b7ee06..d28d631 100644 --- a/generate/templates/.github/workflows/ci-master-pr.yml.ps1 +++ b/generate/templates/.github/workflows/ci-master-pr.yml.ps1 @@ -5,18 +5,20 @@ on: push: branches: - master + - release # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. pull_request: branches: - master - jobs: '@ +$local:WORKFLOW_JOB_NAMES = $VARIANTS | % { "build-$( $_['tag'].Replace('.', '-') )" } $( $VARIANTS | % { @" + build-$( $_['tag'].Replace('.', '-') ): - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest env: VARIANT_TAG: $( $_['tag'] ) # VARIANT_TAG_WITH_REF: $( $_['tag'] )-`${GITHUB_REF} @@ -25,7 +27,9 @@ $( $VARIANTS | % { @' steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v2 + - name: Display system info (linux) run: | set -e @@ -38,36 +42,234 @@ $( $VARIANTS | % { pwd docker info docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image + + # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Prepare + id: prep env: DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} run: | set -e - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) + # Get 'namespace' and 'project-name' from 'namespace/project-name' + # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) + # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) # Get 'ref-name' from 'refs/heads/ref-name' REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - # Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' + # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" + # Set step output(s) + # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" + # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" + # echo "::set-output name=REF::$REF" + # echo "::set-output name=SHA_SHORT::$SHA_SHORT" + # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" + + # For Generate-DockerImageVariants: Set step output(s) + echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" + echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" + echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" + echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" + + - name: Login to docker registry + run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin + env: + DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} + DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} + + - name: Build (PRs) + id: docker_build_pr + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: false + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (master) + id: docker_build_master + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: Build and push (release) + id: docker_build_release + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + uses: docker/build-push-action@v2 + with: + context: ${{ steps.prep.outputs.CONTEXT }} + platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x + push: true + tags: | + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} + ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + +'@ + +if ( $_['tag_as_latest'] ) { +@' + ${{ github.repository }}:latest + +'@ +} +@' + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache + + - name: List docker images + run: docker images + - name: Clean-up run: docker logout if: always() '@ }) + +@" + + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + converge-master-and-release-branches: + needs: [$( $local:WORKFLOW_JOB_NAMES -join ', ' )] + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Merge release into master (fast-forward) + run: | + git checkout master + git merge release + git push origin master +"@ + +@' + + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + resolve-release-tag: + runs-on: ubuntu-latest + outputs: + TAG: ${{ steps.resolve-release-tag.outputs.TAG }} + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Resolve release tag + id: resolve-release-tag + run: | + set +e + # E.g. 20210402 + TODAYS_DATE=$( date -u '+%Y%m%d' ) + # Is this the first tag for this date? + TODAYS_DATE_TAGS=$( git tag --list | grep "^$TODAYS_DATE" ) + TAG= + if [ -z "$TODAYS_DATE_TAGS" ]; then + # E.g. 20210402.0.0 + TAG="$TODAYS_DATE.0.0" # Send this to stdout + else + # E.g. if there are 20210402.0.0, 20210402.0.1, 20210402.0.2, this returns 2 + VERSION_MINOR_LATEST=$( echo "$TODAYS_DATE_TAGS" | cut -d '.' -f 3 | sort -nr | head -n1 ) + # Minor version + VERSION_MINOR=$( expr "$VERSION_MINOR_LATEST" + 1 ) + # E.g. 20210402.0.3 + TAG="$TODAYS_DATE.0.$VERSION_MINOR" # Send this to stdout + fi + echo "TODAYS_DATE: $TODAYS_DATE" + echo "TODAYS_DATE_TAGS: $TODAYS_DATE_TAGS" + echo "TAG: $TAG" + echo "::set-output name=TAG::$TAG" + - name: Print outputs + run: echo ${{ steps.resolve-release-tag.outputs.TAG }} +'@ + +@" + + + update-draft-release: + needs: [$( $local:WORKFLOW_JOB_NAMES -join ', ' ), resolve-release-tag] +"@ +@' + + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Print inputs + run: echo ${{ needs.resolve-release-tag.outputs.TAG }} + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + publish: false + name: ${{ needs.resolve-release-tag.outputs.TAG }} + tag: ${{ needs.resolve-release-tag.outputs.TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +'@ + +@" + + + publish-draft-release: + needs: [$( $local:WORKFLOW_JOB_NAMES -join ', ' ), converge-master-and-release-branches, resolve-release-tag] +"@ +@' + + # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. + # if: startsWith(github.ref, 'refs/tags/') + if: github.ref == 'refs/heads/release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v5 + with: + config-name: release-drafter.yml + publish: true + name: ${{ needs.resolve-release-tag.outputs.TAG }} + tag: ${{ needs.resolve-release-tag.outputs.TAG }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +'@ diff --git a/generate/templates/.github/workflows/ci-release.yml.ps1 b/generate/templates/.github/workflows/ci-release.yml.ps1 deleted file mode 100644 index 87f701c..0000000 --- a/generate/templates/.github/workflows/ci-release.yml.ps1 +++ /dev/null @@ -1,90 +0,0 @@ -@' -name: ci-release - -on: - push: - branches: - - release - -jobs: -'@ - -$( $VARIANTS | % { -@" - - build-$( $_['tag'].Replace('.', '-') ): - runs-on: ubuntu-18.04 - env: - VARIANT_TAG: $( $_['tag'] ) - # VARIANT_TAG_WITH_REF: $( $_['tag'] )-`${GITHUB_REF} - VARIANT_BUILD_DIR: $( $_['build_dir_rel'] ) -"@ -@' - - steps: - - uses: actions/checkout@v1 - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - name: Build and push image - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'project-name' from 'namespace/project-name' - CI_PROJECT_NAME=$( echo "${GITHUB_REPOSITORY}" | rev | cut -d '/' -f 1 | rev ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # Generate the final tags. E.g. 'release-v1.0.0-alpine' and 'release-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - docker build \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" \ - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" \ - -'@ -if ( $_['tag_as_latest'] ) { -@' - -t "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:latest" \ - -'@ -} -@' - "${VARIANT_BUILD_DIR}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF}" - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:${VARIANT_TAG_WITH_REF_AND_SHA_SHORT}" - -'@ -if ( $_['tag_as_latest'] ) { -@' - docker push "${DOCKERHUB_REGISTRY_USER}/${CI_PROJECT_NAME}:latest" - -'@ -} -@' - - name: Clean-up - run: docker logout - if: always() -'@ -}) From 600c1d8f8699a3c54b4ff5b19091e23a6c74f49b Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 12 Sep 2021 20:40:00 +0000 Subject: [PATCH 2/5] Refactor: Keep only two multi-component variants for each alpine version --- .github/workflows/ci-master-pr.yml | 4622 +--------------------------- README.md | 35 - generate/definitions/VARIANTS.ps1 | 7 - 3 files changed, 36 insertions(+), 4628 deletions(-) diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 3996ce5..7513ad9 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -10,4563 +10,12 @@ on: - master jobs: - build-3-12-curl: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-curl - # VARIANT_TAG_WITH_REF: 3.12-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-12-git: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-git - # VARIANT_TAG_WITH_REF: 3.12-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-git - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-12-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-jq - # VARIANT_TAG_WITH_REF: 3.12-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-12-ssh: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-ssh - # VARIANT_TAG_WITH_REF: 3.12-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-ssh - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-12-curl-git: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-curl-git - # VARIANT_TAG_WITH_REF: 3.12-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl-git - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-12-curl-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-curl-jq - # VARIANT_TAG_WITH_REF: 3.12-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-12-curl-git-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.12-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl-git-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-12-curl-git-jq-ssh: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.12-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-curl-git-jq-ssh - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - ${{ github.repository }}:latest - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-12-mysqlclient-openssl: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.12-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.12-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.12-mysqlclient-openssl - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-curl: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-curl - # VARIANT_TAG_WITH_REF: 3.11-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-git: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-git - # VARIANT_TAG_WITH_REF: 3.11-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-git - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-jq - # VARIANT_TAG_WITH_REF: 3.11-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-ssh: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-ssh - # VARIANT_TAG_WITH_REF: 3.11-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-ssh - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-curl-git: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-curl-git - # VARIANT_TAG_WITH_REF: 3.11-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl-git - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-curl-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-curl-jq - # VARIANT_TAG_WITH_REF: 3.11-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-curl-git-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.11-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl-git-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-curl-git-jq-ssh: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.11-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-curl-git-jq-ssh - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-11-mysqlclient-openssl: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.11-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.11-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.11-mysqlclient-openssl - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-curl: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-curl - # VARIANT_TAG_WITH_REF: 3.10-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-git: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-git - # VARIANT_TAG_WITH_REF: 3.10-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-git - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-jq - # VARIANT_TAG_WITH_REF: 3.10-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-ssh: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-ssh - # VARIANT_TAG_WITH_REF: 3.10-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-ssh - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-curl-git: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-curl-git - # VARIANT_TAG_WITH_REF: 3.10-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl-git - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-curl-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-curl-jq - # VARIANT_TAG_WITH_REF: 3.10-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-curl-git-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.10-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl-git-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-curl-git-jq-ssh: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.10-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-curl-git-jq-ssh - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-10-mysqlclient-openssl: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.10-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.10-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.10-mysqlclient-openssl - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-curl: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.9-curl - # VARIANT_TAG_WITH_REF: 3.9-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-git: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.9-git - # VARIANT_TAG_WITH_REF: 3.9-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-git - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.9-jq - # VARIANT_TAG_WITH_REF: 3.9-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-ssh: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.9-ssh - # VARIANT_TAG_WITH_REF: 3.9-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-ssh - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-curl-git: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.9-curl-git - # VARIANT_TAG_WITH_REF: 3.9-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl-git - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-curl-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.9-curl-jq - # VARIANT_TAG_WITH_REF: 3.9-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-curl-git-jq: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.9-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.9-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl-git-jq - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-curl-git-jq-ssh: - runs-on: ubuntu-latest - env: - VARIANT_TAG: 3.9-curl-git-jq-ssh - # VARIANT_TAG_WITH_REF: 3.9-curl-git-jq-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-curl-git-jq-ssh - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Display system info (linux) - run: | - set -e - hostname - whoami - cat /etc/*release - lscpu - free - df -h - pwd - docker info - docker version - - # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@master - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Prepare - id: prep - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - run: | - set -e - - # Get 'namespace' and 'project-name' from 'namespace/project-name' - # CI_PROJECT_NAMESPACE=$( echo "${{ github.repository }}" | cut -d '/' -f 1 ) - # CI_PROJECT_NAME=$( echo "${{ github.repository }}" | cut -d '/' -f 2 ) - - # Get 'ref-name' from 'refs/heads/ref-name' - REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) - SHA_SHORT=$( echo "${GITHUB_SHA}" | cut -c1-7 ) - - # For Generate-DockerImageVariants: Generate the final tags. E.g. 'master-v1.0.0-alpine' and 'master-b29758a-v1.0.0-alpine' - VARIANT_TAG_WITH_REF="${REF}-${VARIANT_TAG}" - VARIANT_TAG_WITH_REF_AND_SHA_SHORT="${REF}-${SHA_SHORT}-${VARIANT_TAG}" - - # Set step output(s) - # echo "::set-output name=CI_PROJECT_NAMESPACE::$CI_PROJECT_NAMESPACE" - # echo "::set-output name=CI_PROJECT_NAME::$CI_PROJECT_NAME" - # echo "::set-output name=REF::$REF" - # echo "::set-output name=SHA_SHORT::$SHA_SHORT" - # echo "::set-output name=REF_AND_SHA_SHORT::$REF_AND_SHA_SHORT" - - # For Generate-DockerImageVariants: Set step output(s) - echo "::set-output name=CONTEXT::$VARIANT_BUILD_DIR" - echo "::set-output name=VARIANT_TAG::$VARIANT_TAG" - echo "::set-output name=VARIANT_TAG_WITH_REF::$VARIANT_TAG_WITH_REF" - echo "::set-output name=VARIANT_TAG_WITH_REF_AND_SHA_SHORT::$VARIANT_TAG_WITH_REF_AND_SHA_SHORT" - - - name: Login to docker registry - run: echo "${DOCKERHUB_REGISTRY_PASSWORD}" | docker login -u "${DOCKERHUB_REGISTRY_USER}" --password-stdin - env: - DOCKERHUB_REGISTRY_USER: ${{ secrets.DOCKERHUB_REGISTRY_USER }} - DOCKERHUB_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_REGISTRY_PASSWORD }} - - - name: Build (PRs) - id: docker_build_pr - # Run only on pull requests - if: github.event_name == 'pull_request' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: false - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (master) - id: docker_build_master - # Run only on master - if: github.ref == 'refs/heads/master' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Build and push (release) - id: docker_build_release - # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. - # if: startsWith(github.ref, 'refs/tags/') - if: github.ref == 'refs/heads/release' - uses: docker/build-push-action@v2 - with: - context: ${{ steps.prep.outputs.CONTEXT }} - platforms: linux/386,linux/amd64,linux/arm,linux/arm64,linux/s390x - push: true - tags: | - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} - ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: List docker images - run: docker images - - - name: Clean-up - run: docker logout - if: always() - - build-3-9-mysqlclient-openssl: + build-3-12-curl-git-jq-ssh: runs-on: ubuntu-latest env: - VARIANT_TAG: 3.9-mysqlclient-openssl - # VARIANT_TAG_WITH_REF: 3.9-mysqlclient-openssl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.9-mysqlclient-openssl + VARIANT_TAG: 3.12-curl-git-jq-ssh + # VARIANT_TAG_WITH_REF: 3.12-curl-git-jq-ssh-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/3.12-curl-git-jq-ssh steps: - name: Checkout uses: actions/checkout@v2 @@ -4681,6 +130,7 @@ jobs: ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG }} ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF }} ${{ github.repository }}:${{ steps.prep.outputs.VARIANT_TAG_WITH_REF_AND_SHA_SHORT }} + ${{ github.repository }}:latest cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache @@ -4691,12 +141,12 @@ jobs: run: docker logout if: always() - build-3-8-curl: + build-3-12-mysqlclient-openssl: runs-on: ubuntu-latest env: - VARIANT_TAG: 3.8-curl - # VARIANT_TAG_WITH_REF: 3.8-curl-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl + VARIANT_TAG: 3.12-mysqlclient-openssl + # VARIANT_TAG_WITH_REF: 3.12-mysqlclient-openssl-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/3.12-mysqlclient-openssl steps: - name: Checkout uses: actions/checkout@v2 @@ -4821,12 +271,12 @@ jobs: run: docker logout if: always() - build-3-8-git: + build-3-11-curl-git-jq-ssh: runs-on: ubuntu-latest env: - VARIANT_TAG: 3.8-git - # VARIANT_TAG_WITH_REF: 3.8-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-git + VARIANT_TAG: 3.11-curl-git-jq-ssh + # VARIANT_TAG_WITH_REF: 3.11-curl-git-jq-ssh-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/3.11-curl-git-jq-ssh steps: - name: Checkout uses: actions/checkout@v2 @@ -4951,12 +401,12 @@ jobs: run: docker logout if: always() - build-3-8-jq: + build-3-11-mysqlclient-openssl: runs-on: ubuntu-latest env: - VARIANT_TAG: 3.8-jq - # VARIANT_TAG_WITH_REF: 3.8-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-jq + VARIANT_TAG: 3.11-mysqlclient-openssl + # VARIANT_TAG_WITH_REF: 3.11-mysqlclient-openssl-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/3.11-mysqlclient-openssl steps: - name: Checkout uses: actions/checkout@v2 @@ -5081,12 +531,12 @@ jobs: run: docker logout if: always() - build-3-8-ssh: + build-3-10-curl-git-jq-ssh: runs-on: ubuntu-latest env: - VARIANT_TAG: 3.8-ssh - # VARIANT_TAG_WITH_REF: 3.8-ssh-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-ssh + VARIANT_TAG: 3.10-curl-git-jq-ssh + # VARIANT_TAG_WITH_REF: 3.10-curl-git-jq-ssh-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/3.10-curl-git-jq-ssh steps: - name: Checkout uses: actions/checkout@v2 @@ -5211,12 +661,12 @@ jobs: run: docker logout if: always() - build-3-8-curl-git: + build-3-10-mysqlclient-openssl: runs-on: ubuntu-latest env: - VARIANT_TAG: 3.8-curl-git - # VARIANT_TAG_WITH_REF: 3.8-curl-git-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl-git + VARIANT_TAG: 3.10-mysqlclient-openssl + # VARIANT_TAG_WITH_REF: 3.10-mysqlclient-openssl-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/3.10-mysqlclient-openssl steps: - name: Checkout uses: actions/checkout@v2 @@ -5341,12 +791,12 @@ jobs: run: docker logout if: always() - build-3-8-curl-jq: + build-3-9-curl-git-jq-ssh: runs-on: ubuntu-latest env: - VARIANT_TAG: 3.8-curl-jq - # VARIANT_TAG_WITH_REF: 3.8-curl-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl-jq + VARIANT_TAG: 3.9-curl-git-jq-ssh + # VARIANT_TAG_WITH_REF: 3.9-curl-git-jq-ssh-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/3.9-curl-git-jq-ssh steps: - name: Checkout uses: actions/checkout@v2 @@ -5471,12 +921,12 @@ jobs: run: docker logout if: always() - build-3-8-curl-git-jq: + build-3-9-mysqlclient-openssl: runs-on: ubuntu-latest env: - VARIANT_TAG: 3.8-curl-git-jq - # VARIANT_TAG_WITH_REF: 3.8-curl-git-jq-${GITHUB_REF} - VARIANT_BUILD_DIR: variants/3.8-curl-git-jq + VARIANT_TAG: 3.9-mysqlclient-openssl + # VARIANT_TAG_WITH_REF: 3.9-mysqlclient-openssl-${GITHUB_REF} + VARIANT_BUILD_DIR: variants/3.9-mysqlclient-openssl steps: - name: Checkout uses: actions/checkout@v2 @@ -5863,7 +1313,7 @@ jobs: # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. converge-master-and-release-branches: - needs: [build-3-12-curl, build-3-12-git, build-3-12-jq, build-3-12-ssh, build-3-12-curl-git, build-3-12-curl-jq, build-3-12-curl-git-jq, build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl, build-3-11-git, build-3-11-jq, build-3-11-ssh, build-3-11-curl-git, build-3-11-curl-jq, build-3-11-curl-git-jq, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl, build-3-10-git, build-3-10-jq, build-3-10-ssh, build-3-10-curl-git, build-3-10-curl-jq, build-3-10-curl-git-jq, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl, build-3-9-git, build-3-9-jq, build-3-9-ssh, build-3-9-curl-git, build-3-9-curl-jq, build-3-9-curl-git-jq, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl, build-3-8-git, build-3-8-jq, build-3-8-ssh, build-3-8-curl-git, build-3-8-curl-jq, build-3-8-curl-git-jq, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl] + needs: [build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl] if: github.ref == 'refs/heads/release' runs-on: ubuntu-latest steps: @@ -5913,7 +1363,7 @@ jobs: run: echo ${{ steps.resolve-release-tag.outputs.TAG }} update-draft-release: - needs: [build-3-12-curl, build-3-12-git, build-3-12-jq, build-3-12-ssh, build-3-12-curl-git, build-3-12-curl-jq, build-3-12-curl-git-jq, build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl, build-3-11-git, build-3-11-jq, build-3-11-ssh, build-3-11-curl-git, build-3-11-curl-jq, build-3-11-curl-git-jq, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl, build-3-10-git, build-3-10-jq, build-3-10-ssh, build-3-10-curl-git, build-3-10-curl-jq, build-3-10-curl-git-jq, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl, build-3-9-git, build-3-9-jq, build-3-9-ssh, build-3-9-curl-git, build-3-9-curl-jq, build-3-9-curl-git-jq, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl, build-3-8-git, build-3-8-jq, build-3-8-ssh, build-3-8-curl-git, build-3-8-curl-jq, build-3-8-curl-git-jq, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl, resolve-release-tag] + needs: [build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl, resolve-release-tag] if: github.ref == 'refs/heads/master' runs-on: ubuntu-latest steps: @@ -5933,7 +1383,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} publish-draft-release: - needs: [build-3-12-curl, build-3-12-git, build-3-12-jq, build-3-12-ssh, build-3-12-curl-git, build-3-12-curl-jq, build-3-12-curl-git-jq, build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl, build-3-11-git, build-3-11-jq, build-3-11-ssh, build-3-11-curl-git, build-3-11-curl-jq, build-3-11-curl-git-jq, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl, build-3-10-git, build-3-10-jq, build-3-10-ssh, build-3-10-curl-git, build-3-10-curl-jq, build-3-10-curl-git-jq, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl, build-3-9-git, build-3-9-jq, build-3-9-ssh, build-3-9-curl-git, build-3-9-curl-jq, build-3-9-curl-git-jq, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl, build-3-8-git, build-3-8-jq, build-3-8-ssh, build-3-8-curl-git, build-3-8-curl-jq, build-3-8-curl-git-jq, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl, converge-master-and-release-branches, resolve-release-tag] + needs: [build-3-12-curl-git-jq-ssh, build-3-12-mysqlclient-openssl, build-3-11-curl-git-jq-ssh, build-3-11-mysqlclient-openssl, build-3-10-curl-git-jq-ssh, build-3-10-mysqlclient-openssl, build-3-9-curl-git-jq-ssh, build-3-9-mysqlclient-openssl, build-3-8-curl-git-jq-ssh, build-3-8-mysqlclient-openssl, converge-master-and-release-branches, resolve-release-tag] # For Generate-DockerImageVariants: For CalVer releases. Each push to 'release' branch is a time-based release. # if: startsWith(github.ref, 'refs/tags/') if: github.ref == 'refs/heads/release' diff --git a/README.md b/README.md index 718c7ab..a876e32 100644 --- a/README.md +++ b/README.md @@ -10,48 +10,13 @@ Dockerized alpine with useful tools. | Tag | Dockerfile Build Context | |:-------:|:---------:| -| `:3.12-curl` | [View](variants/3.12-curl ) | -| `:3.12-git` | [View](variants/3.12-git ) | -| `:3.12-jq` | [View](variants/3.12-jq ) | -| `:3.12-ssh` | [View](variants/3.12-ssh ) | -| `:3.12-curl-git` | [View](variants/3.12-curl-git ) | -| `:3.12-curl-jq` | [View](variants/3.12-curl-jq ) | -| `:3.12-curl-git-jq` | [View](variants/3.12-curl-git-jq ) | | `:3.12-curl-git-jq-ssh`, `:latest` | [View](variants/3.12-curl-git-jq-ssh ) | | `:3.12-mysqlclient-openssl` | [View](variants/3.12-mysqlclient-openssl ) | -| `:3.11-curl` | [View](variants/3.11-curl ) | -| `:3.11-git` | [View](variants/3.11-git ) | -| `:3.11-jq` | [View](variants/3.11-jq ) | -| `:3.11-ssh` | [View](variants/3.11-ssh ) | -| `:3.11-curl-git` | [View](variants/3.11-curl-git ) | -| `:3.11-curl-jq` | [View](variants/3.11-curl-jq ) | -| `:3.11-curl-git-jq` | [View](variants/3.11-curl-git-jq ) | | `:3.11-curl-git-jq-ssh` | [View](variants/3.11-curl-git-jq-ssh ) | | `:3.11-mysqlclient-openssl` | [View](variants/3.11-mysqlclient-openssl ) | -| `:3.10-curl` | [View](variants/3.10-curl ) | -| `:3.10-git` | [View](variants/3.10-git ) | -| `:3.10-jq` | [View](variants/3.10-jq ) | -| `:3.10-ssh` | [View](variants/3.10-ssh ) | -| `:3.10-curl-git` | [View](variants/3.10-curl-git ) | -| `:3.10-curl-jq` | [View](variants/3.10-curl-jq ) | -| `:3.10-curl-git-jq` | [View](variants/3.10-curl-git-jq ) | | `:3.10-curl-git-jq-ssh` | [View](variants/3.10-curl-git-jq-ssh ) | | `:3.10-mysqlclient-openssl` | [View](variants/3.10-mysqlclient-openssl ) | -| `:3.9-curl` | [View](variants/3.9-curl ) | -| `:3.9-git` | [View](variants/3.9-git ) | -| `:3.9-jq` | [View](variants/3.9-jq ) | -| `:3.9-ssh` | [View](variants/3.9-ssh ) | -| `:3.9-curl-git` | [View](variants/3.9-curl-git ) | -| `:3.9-curl-jq` | [View](variants/3.9-curl-jq ) | -| `:3.9-curl-git-jq` | [View](variants/3.9-curl-git-jq ) | | `:3.9-curl-git-jq-ssh` | [View](variants/3.9-curl-git-jq-ssh ) | | `:3.9-mysqlclient-openssl` | [View](variants/3.9-mysqlclient-openssl ) | -| `:3.8-curl` | [View](variants/3.8-curl ) | -| `:3.8-git` | [View](variants/3.8-git ) | -| `:3.8-jq` | [View](variants/3.8-jq ) | -| `:3.8-ssh` | [View](variants/3.8-ssh ) | -| `:3.8-curl-git` | [View](variants/3.8-curl-git ) | -| `:3.8-curl-jq` | [View](variants/3.8-curl-jq ) | -| `:3.8-curl-git-jq` | [View](variants/3.8-curl-git-jq ) | | `:3.8-curl-git-jq-ssh` | [View](variants/3.8-curl-git-jq-ssh ) | | `:3.8-mysqlclient-openssl` | [View](variants/3.8-mysqlclient-openssl ) | diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index 356d378..e96e310 100644 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -12,13 +12,6 @@ $local:VARIANTS_MATRIX = @( distro = 'alpine' distro_version = $v subvariants = @( - @{ components = @( 'curl' ) } - @{ components = @( 'git' ) } - @{ components = @( 'jq' ) } - @{ components = @( 'ssh' ) } - @{ components = @( 'curl', 'git' ) } - @{ components = @( 'curl', 'jq' ) } - @{ components = @( 'curl', 'git', 'jq' ) } @{ components = @( 'curl', 'git', 'jq', 'ssh' ); tag_as_latest = if ($v -eq $local:VARIANTS_DISTRO_VERSIONS[0]) { $true } else { $false } } @{ components = @( 'mysqlclient', 'openssl' ) } ) From 31da1c8d4ac145fb9edb5f8b6b2aa029a51be538 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 12 Sep 2021 20:31:07 +0000 Subject: [PATCH 3/5] Enhancement (development): Add .vscode/tasks.json --- .vscode/tasks.json | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .vscode/tasks.json diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..5d409e9 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,30 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Generate-DockerImageVariants", + "type": "process", + "command": "pwsh", + "args": [ + "-c", + "Generate-DockerImageVariants ." + ], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Install DockerImageVariants module", + "type": "process", + "command": "pwsh", + "args": [ + "-c", + "Install-Module -Name Generate-DockerImageVariants -Repository PSGallery -Scope CurrentUser -Force -Verbose" + ], + "group": "build" + } + ] +} From 67865271011e9cffb1c2c9ae2795fe764e0bebc2 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 12 Sep 2021 20:45:15 +0000 Subject: [PATCH 4/5] Refactor (generate): Remove Dockerfile.header.ps1 and Dockerfile.footer.ps1 and only use Dockerfile.ps1 --- generate/definitions/VARIANTS.ps1 | 4 ++-- generate/templates/Dockerfile.footer.ps1 | 2 -- generate/templates/Dockerfile.header.ps1 | 3 --- generate/templates/Dockerfile.ps1 | 12 +++++++----- variants/3.10-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.10-mysqlclient-openssl/Dockerfile | 2 -- variants/3.11-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.11-mysqlclient-openssl/Dockerfile | 2 -- variants/3.12-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.12-mysqlclient-openssl/Dockerfile | 2 -- variants/3.8-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.8-mysqlclient-openssl/Dockerfile | 2 -- variants/3.9-curl-git-jq-ssh/Dockerfile | 2 -- variants/3.9-mysqlclient-openssl/Dockerfile | 2 -- 14 files changed, 9 insertions(+), 32 deletions(-) delete mode 100644 generate/templates/Dockerfile.footer.ps1 delete mode 100644 generate/templates/Dockerfile.header.ps1 diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index e96e310..4a5069d 100644 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -50,8 +50,8 @@ $VARIANTS_SHARED = @{ templates = @{ 'Dockerfile' = @{ common = $true - includeHeader = $true - includeFooter = $true + includeHeader = $false + includeFooter = $false passes = @( @{ variables = @{} diff --git a/generate/templates/Dockerfile.footer.ps1 b/generate/templates/Dockerfile.footer.ps1 deleted file mode 100644 index d008103..0000000 --- a/generate/templates/Dockerfile.footer.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -@" -"@ diff --git a/generate/templates/Dockerfile.header.ps1 b/generate/templates/Dockerfile.header.ps1 deleted file mode 100644 index f379361..0000000 --- a/generate/templates/Dockerfile.header.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -@" -FROM $( $VARIANT['_metadata']['distro'] ):$( $VARIANT['_metadata']['distro_version'] ) -"@ diff --git a/generate/templates/Dockerfile.ps1 b/generate/templates/Dockerfile.ps1 index 3ca9fd3..0bc2f2b 100644 --- a/generate/templates/Dockerfile.ps1 +++ b/generate/templates/Dockerfile.ps1 @@ -1,6 +1,10 @@ @" -$( -($VARIANT['_metadata']['components'] | % { +FROM $( $VARIANT['_metadata']['distro'] ):$( $VARIANT['_metadata']['distro_version'] ) + + +"@ + +$VARIANT['_metadata']['components'] | % { $component = $_ switch( $component ) { @@ -58,6 +62,4 @@ RUN apk add --no-cache openssh throw "No such component: $component" } } -}) -join '' -) -"@ +} diff --git a/variants/3.10-curl-git-jq-ssh/Dockerfile b/variants/3.10-curl-git-jq-ssh/Dockerfile index d1bf021..72cb812 100644 --- a/variants/3.10-curl-git-jq-ssh/Dockerfile +++ b/variants/3.10-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.10-mysqlclient-openssl/Dockerfile b/variants/3.10-mysqlclient-openssl/Dockerfile index 2473515..3900613 100644 --- a/variants/3.10-mysqlclient-openssl/Dockerfile +++ b/variants/3.10-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - diff --git a/variants/3.11-curl-git-jq-ssh/Dockerfile b/variants/3.11-curl-git-jq-ssh/Dockerfile index 7e5c85c..50dd380 100644 --- a/variants/3.11-curl-git-jq-ssh/Dockerfile +++ b/variants/3.11-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.11-mysqlclient-openssl/Dockerfile b/variants/3.11-mysqlclient-openssl/Dockerfile index d3be6e5..ee217fa 100644 --- a/variants/3.11-mysqlclient-openssl/Dockerfile +++ b/variants/3.11-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - diff --git a/variants/3.12-curl-git-jq-ssh/Dockerfile b/variants/3.12-curl-git-jq-ssh/Dockerfile index 2de8cca..c9370ae 100644 --- a/variants/3.12-curl-git-jq-ssh/Dockerfile +++ b/variants/3.12-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.12-mysqlclient-openssl/Dockerfile b/variants/3.12-mysqlclient-openssl/Dockerfile index b4cb6c3..3b55aed 100644 --- a/variants/3.12-mysqlclient-openssl/Dockerfile +++ b/variants/3.12-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - diff --git a/variants/3.8-curl-git-jq-ssh/Dockerfile b/variants/3.8-curl-git-jq-ssh/Dockerfile index 6ad16d8..45c8871 100644 --- a/variants/3.8-curl-git-jq-ssh/Dockerfile +++ b/variants/3.8-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.8-mysqlclient-openssl/Dockerfile b/variants/3.8-mysqlclient-openssl/Dockerfile index 0c1a952..1fe1c55 100644 --- a/variants/3.8-mysqlclient-openssl/Dockerfile +++ b/variants/3.8-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - diff --git a/variants/3.9-curl-git-jq-ssh/Dockerfile b/variants/3.9-curl-git-jq-ssh/Dockerfile index 62777ea..9bc61fb 100644 --- a/variants/3.9-curl-git-jq-ssh/Dockerfile +++ b/variants/3.9-curl-git-jq-ssh/Dockerfile @@ -8,5 +8,3 @@ RUN apk add --no-cache jq RUN apk add --no-cache openssh - - diff --git a/variants/3.9-mysqlclient-openssl/Dockerfile b/variants/3.9-mysqlclient-openssl/Dockerfile index 56d8d45..ee7672c 100644 --- a/variants/3.9-mysqlclient-openssl/Dockerfile +++ b/variants/3.9-mysqlclient-openssl/Dockerfile @@ -4,5 +4,3 @@ RUN apk add --no-cache mysql-client RUN apk add --no-cache openssl - - From f1452cd4049ca7336b489c6e520c73968d598361 Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sun, 12 Sep 2021 20:50:40 +0000 Subject: [PATCH 5/5] Docs (readme): Replace tag badge with release badge --- README.md | 2 +- generate/templates/README.md.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a876e32..31314c5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # docker-alpine [![github-actions](https://github.com/theohbrothers/docker-alpine/workflows/ci-master-pr/badge.svg)](https://github.com/theohbrothers/docker-alpine/actions) -[![github-tag](https://img.shields.io/github/tag/theohbrothers/docker-alpine)](https://github.com/theohbrothers/docker-alpine/releases/) +[![github-release](https://img.shields.io/github/v/release/theohbrothers/docker-alpine?style=flat-square)](https://github.com/theohbrothers/docker-alpine/releases/) [![docker-image-size](https://img.shields.io/docker/image-size/theohbrothers/docker-alpine/latest)](https://hub.docker.com/r/theohbrothers/docker-alpine) Dockerized alpine with useful tools. diff --git a/generate/templates/README.md.ps1 b/generate/templates/README.md.ps1 index b741e91..00faf33 100644 --- a/generate/templates/README.md.ps1 +++ b/generate/templates/README.md.ps1 @@ -2,7 +2,7 @@ # docker-alpine [![github-actions](https://github.com/theohbrothers/docker-alpine/workflows/ci-master-pr/badge.svg)](https://github.com/theohbrothers/docker-alpine/actions) -[![github-tag](https://img.shields.io/github/tag/theohbrothers/docker-alpine)](https://github.com/theohbrothers/docker-alpine/releases/) +[![github-release](https://img.shields.io/github/v/release/theohbrothers/docker-alpine?style=flat-square)](https://github.com/theohbrothers/docker-alpine/releases/) [![docker-image-size](https://img.shields.io/docker/image-size/theohbrothers/docker-alpine/latest)](https://hub.docker.com/r/theohbrothers/docker-alpine) Dockerized alpine with useful tools.