summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2020-04-21 20:03:27 -0400
committerDave Henderson <dhenderson@gmail.com>2020-04-21 20:51:28 -0400
commit18bcbadc8357bf907f9f5a4aa2e70d207f3ea847 (patch)
tree50ca013a77b9dc6308e767b00a27794ca9830f30 /.github
parentbba3ab776873c0b9e8050a656a1742ad8d88c0f0 (diff)
Push all multi-arch docker images
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/docker.yml56
1 files changed, 20 insertions, 36 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
index bc46192b..2a6952a6 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker.yml
@@ -47,48 +47,32 @@ jobs:
run: |
# NOTE: DOCKERHUB_TOKEN and DOCKERHUB_USERNAME must be present in https://github.com/hairyhenderson/gomplate/settings
echo ${{ secrets.DOCKERHUB_TOKEN }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- - name: Make/Push temporary Docker images
- run: make docker-multi COMMIT=${{ github.sha }} DOCKER_REPO=localhost:5000/gomplate
- env:
- COMMIT: ${{ github.sha }}
- - name: Pull the temporary images
+ - name: Build & Push (non-master)
run: |
- docker pull localhost:5000/gomplate:latest-${{ github.sha }}
- docker pull localhost:5000/gomplate:slim-${{ github.sha }}
- docker pull localhost:5000/gomplate:alpine-${{ github.sha }}
- - name: Re-tag and list images (non-master)
- run: |
- docker tag localhost:5000/gomplate:latest-${{ github.sha }} hairyhenderson/gomplate:latest
- docker tag localhost:5000/gomplate:slim-${{ github.sha }} hairyhenderson/gomplate:slim
- docker tag localhost:5000/gomplate:alpine-${{ github.sha }} hairyhenderson/gomplate:alpine
+ set -ex
+ make docker-multi COMMIT=${{ github.sha }} DOCKER_REPO=localhost:5000/gomplate BUILDX_ACTION=--push
- docker images
+ docker buildx imagetools create --dry-run -t localhost:5000/gomplate:dev localhost:5000/gomplate:latest
+ docker buildx imagetools create --dry-run -t localhost:5000/gomplate:dev-slim localhost:5000/gomplate:slim
+ docker buildx imagetools create --dry-run -t localhost:5000/gomplate:dev-alpine localhost:5000/gomplate:alpine
if: github.repository != 'hairyhenderson/gomplate' || github.ref != 'refs/heads/master'
- - name: Re-tag and push (master)
+ - name: Build & Push (master)
run: |
- docker tag localhost:5000/gomplate:latest-${{ github.sha }} hairyhenderson/gomplate:latest
- docker tag localhost:5000/gomplate:slim-${{ github.sha }} hairyhenderson/gomplate:slim
- docker tag localhost:5000/gomplate:alpine-${{ github.sha }} hairyhenderson/gomplate:alpine
-
- docker images
- docker push hairyhenderson/gomplate
+ make docker-multi COMMIT=${{ github.sha }} DOCKER_REPO=hairyhenderson/gomplate BUILDX_ACTION=--push
if: github.repository == 'hairyhenderson/gomplate' && github.ref == 'refs/heads/master'
- - name: Re-tag and push (tagged release)
+ - name: Build & Push (tagged release)
run: |
- docker tag localhost:5000/gomplate:latest-${{ github.sha }} hairyhenderson/gomplate:latest
- docker tag localhost:5000/gomplate:slim-${{ github.sha }} hairyhenderson/gomplate:slim
- docker tag localhost:5000/gomplate:alpine-${{ github.sha }} hairyhenderson/gomplate:alpine
+ make docker-multi COMMIT=${{ github.sha }} DOCKER_REPO=hairyhenderson/gomplate BUILDX_ACTION=--push
- docker tag localhost:5000/gomplate:latest-${{ github.sha }} hairyhenderson/gomplate:${git_tag}
- docker tag localhost:5000/gomplate:latest-${{ github.sha }} hairyhenderson/gomplate:stable
- docker tag localhost:5000/gomplate:latest-${{ github.sha }} hairyhenderson/gomplate:${major_version}
- docker tag localhost:5000/gomplate:slim-${{ github.sha }} hairyhenderson/gomplate:${git_tag}-slim
- docker tag localhost:5000/gomplate:slim-${{ github.sha }} hairyhenderson/gomplate:${major_version}-slim
- docker tag localhost:5000/gomplate:slim-${{ github.sha }} hairyhenderson/gomplate:stable-slim
- docker tag localhost:5000/gomplate:alpine-${{ github.sha }} hairyhenderson/gomplate:${git_tag}-alpine
- docker tag localhost:5000/gomplate:alpine-${{ github.sha }} hairyhenderson/gomplate:${major_version}-alpine
- docker tag localhost:5000/gomplate:alpine-${{ github.sha }} hairyhenderson/gomplate:stable-alpine
+ docker buildx imagetools create -t localhost:5000/gomplate:stable localhost:5000/gomplate:latest
+ docker buildx imagetools create -t localhost:5000/gomplate:${git_tag} localhost:5000/gomplate:latest
+ docker buildx imagetools create -t localhost:5000/gomplate:${major_version} localhost:5000/gomplate:latest
- docker images
- docker push hairyhenderson/gomplate
+ docker buildx imagetools create -t localhost:5000/gomplate:stable-slim localhost:5000/gomplate:slim
+ docker buildx imagetools create -t localhost:5000/gomplate:${git_tag}-slim localhost:5000/gomplate:slim
+ docker buildx imagetools create -t localhost:5000/gomplate:${major_version}-slim localhost:5000/gomplate:slim
+
+ docker buildx imagetools create -t localhost:5000/gomplate:stable-alpine localhost:5000/gomplate:alpine
+ docker buildx imagetools create -t localhost:5000/gomplate:${git_tag}-alpine localhost:5000/gomplate:alpine
+ docker buildx imagetools create -t localhost:5000/gomplate:${major_version}-alpine localhost:5000/gomplate:alpine
if: github.repository == 'hairyhenderson/gomplate' && env.is_tag == 'true'