Add amd64 images tagging and push to DockerHub

This commit is contained in:
Ayaz Salikhov
2022-05-12 20:35:16 +03:00
parent 5b03f3a5b1
commit 539159f0d1
3 changed files with 65 additions and 1 deletions

View File

@@ -85,3 +85,14 @@ jobs:
imageName: minimal-notebook
platform: amd64
runsOn: ubuntu-latest
amd64-images-tag-push:
needs: [test-amd64-base-notebook, test-amd64-minimal-notebook]
strategy:
matrix:
image: [base-notebook, minimal-notebook]
uses: ./.github/workflows/sub-tag-push-image.yml
with:
imageName: ${{ matrix.image }}
platform: amd64
runsOn: ubuntu-latest

View File

@@ -0,0 +1,53 @@
name: Download image artifact from GitHub artifacts, tag it and push to DockerHub
on:
workflow_call:
inputs:
imageName:
description: "Image name to be pushed"
required: true
type: string
platform:
description: "Target platform for the built image"
required: true
type: string
runsOn:
description: "Image to be run on"
required: true
type: string
jobs:
test-image:
runs-on: ${{ inputs.runsOn }}
steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v3
- name: Create dev environment 📦
uses: ./.github/actions/create-dev-env
- name: Download built image 📥
uses: actions/download-artifact@v3
with:
name: ${{ inputs.imageName }}-${{ inputs.platform }}
path: /tmp/
- name: Load downloaded image to docker 📥
run: |
docker load --input /tmp/${{ inputs.imageName }}-${{ inputs.platform }}.tar
docker image ls -a
shell: bash
- name: Create tags and manifest 🏷
run: python3 -m tagging.tag_image --short-image-name ${{ inputs.imageName }}
shell: bash
- name: Login to Docker Hub 🔐
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule'
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # dependabot updates to latest release
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Images to Docker Hub 📤
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event_name == 'schedule'
run: docker push --all-tags jupyter/${{ inputs.imageName }}
shell: bash

View File

@@ -56,7 +56,7 @@ if __name__ == "__main__":
required=True,
help="Short image name to apply tags for",
)
arg_parser.add_argument("--owner", required=True, help="Owner of the image")
arg_parser.add_argument("--owner", default="jupyter", help="Owner of the image")
args = arg_parser.parse_args()
tag_image(args.short_image_name, args.owner)