release-images.yml 3.38 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
name: Release all images

on:
  workflow_dispatch:
    inputs:
      namespace:
        description: "The namespace into which the images are released"
        required: true
        default: daewok

env:
  DOCKER_CLI_EXPERIMENTAL: "enabled"
  IMAGE_NAME: ccl
  IMAGE_BUILD_NAMESPACE: daewok
  IMAGE_TARGET_NAMESPACE: ${{ github.event.inputs.namespace }}
  VERSION: "1.12"

jobs:
  release_linux:
    name: Release Linux images
    runs-on: ubuntu-20.04
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
Eric Timmons's avatar
Eric Timmons committed
25
26
        with:
          submodules: true
27
28
29
30
31
32
33
34
35
36
37
38
39
      - name: Login to Dockerhub
        env:
          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
        run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
      - name: Release Linux Images
        run: ./cl-docker-images-build/cl-docker-images-build release_linux_manifests
  release_windows:
    name: Release Windows images
    runs-on: ubuntu-20.04
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
Eric Timmons's avatar
Eric Timmons committed
40
41
        with:
          submodules: true
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
      - name: Login to Dockerhub
        env:
          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
        run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
      - name: Release Windows Images
        run: |
          create_manifest_for_windows () {
            docker manifest create $IMAGE_TARGET_NAMESPACE/$IMAGE_NAME:$1 ${IMAGE_BUILD_NAMESPACE}winamd64/$IMAGE_NAME:$1
            docker manifest push -p $IMAGE_TARGET_NAMESPACE/$IMAGE_NAME:$1
          }
          create_manifest_for_windows $VERSION-windowsservercore-ltsc2019
          create_manifest_for_windows windowsservercore-ltsc2019
          create_manifest_for_windows $VERSION-windowsservercore
          create_manifest_for_windows windowsservercore
          create_manifest_for_windows latest-windowsservercore

  release_shared:
    name: Release shared tags
    runs-on: ubuntu-20.04
    needs:
      - release_linux
      - release_windows
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
Eric Timmons's avatar
Eric Timmons committed
68
69
        with:
          submodules: true
70
71
72
73
74
75
76
      - name: Login to Dockerhub
        env:
          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
        run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
      - name: Release Shared Tags
        run: ./cl-docker-images-build/cl-docker-images-build release_shared_manifests
Eric Timmons's avatar
Eric Timmons committed
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

  release_readme:
    name: Release readme
    runs-on: ubuntu-20.04
    needs:
      - release_shared
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
      - name: Login to Dockerhub
        env:
          DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
        run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
      - name: Push README
        run: |
          docker run -i \
                 -v $(pwd):/repo \
                 -e DOCKER_USER=$DOCKER_USERNAME \
                 -e DOCKER_PASS=$DOCKER_PASSWORD \
                 chko/docker-pushrm:1 \
                 --file /repo/hub-description.md \
                 --debug \
                 ${IMAGE_TARGET_NAMESPACE}/${IMAGE_NAME}