github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/.github/workflows/operator-images.yaml (about)

     1  name: operator images
     2  
     3  on:
     4    push:
     5      paths:
     6        - 'operator/**'
     7      branches:
     8        - main
     9  
    10  env:
    11    IMAGE_REGISTRY: quay.io
    12    IMAGE_ORGANIZATION: openshift-logging
    13    IMAGE_OPERATOR_NAME: loki-operator
    14    IMAGE_BUNDLE_NAME: loki-operator-bundle
    15    IMAGE_CALCULATOR_NAME: storage-size-calculator
    16  
    17  jobs:
    18   publish-manager:
    19     runs-on: ubuntu-latest
    20     steps:
    21       - uses: actions/checkout@v3
    22  
    23       - name: Set up QEMU
    24         uses: docker/setup-qemu-action@v1
    25  
    26       - name: Set up Docker Buildx
    27         uses: docker/setup-buildx-action@v1
    28  
    29       - name: Login to Quay.io
    30         uses: docker/login-action@v1
    31         with:
    32           registry: quay.io
    33           logout: true
    34           username: ${{ secrets.OPENSHIFT_LOGGING_USER }}
    35           password: ${{ secrets.OPENSHIFT_LOGGING_PASS }}
    36  
    37       - name: Get image tags
    38         id: image_tags
    39         run: |
    40           echo -n ::set-output name=IMAGE_TAGS::
    41           PULLSPEC="$IMAGE_REGISTRY/$IMAGE_ORGANIZATION/$IMAGE_OPERATOR_NAME"
    42           TAGS=("$PULLSPEC:latest", "$PULLSPEC:v0.0.1")
    43           BUILD_DATE="$(date -u +'%Y-%m-%d')"
    44           VCS_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
    45           VCS_REF="$(git rev-parse --short HEAD)"
    46           TAGS+=("$PULLSPEC:$VCS_BRANCH-$BUILD_DATE-$VCS_REF")
    47           ( IFS=$','; echo "${TAGS[*]}" )
    48  
    49       - name: Build and publish image on quay.io
    50         uses: docker/build-push-action@v2
    51         with:
    52           context: ./operator
    53           push: true
    54           tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}"
    55  
    56   publish-bundle:
    57     runs-on: ubuntu-latest
    58     steps:
    59       - uses: actions/checkout@v3
    60  
    61       - name: Set up QEMU
    62         uses: docker/setup-qemu-action@v1
    63  
    64       - name: Set up Docker Buildx
    65         uses: docker/setup-buildx-action@v1
    66  
    67       - name: Login to Quay.io
    68         uses: docker/login-action@v1
    69         with:
    70           registry: quay.io
    71           logout: true
    72           username: ${{ secrets.OPENSHIFT_LOGGING_USER }}
    73           password: ${{ secrets.OPENSHIFT_LOGGING_PASS }}
    74  
    75       - name: Get image tags
    76         id: image_tags
    77         run: |
    78           echo -n ::set-output name=IMAGE_TAGS::
    79           PULLSPEC="$IMAGE_REGISTRY/$IMAGE_ORGANIZATION/$IMAGE_BUNDLE_NAME"
    80           TAGS=("$PULLSPEC:latest", "$PULLSPEC:v0.0.1")
    81           BUILD_DATE="$(date -u +'%Y-%m-%d')"
    82           VCS_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
    83           VCS_REF="$(git rev-parse --short HEAD)"
    84           TAGS+=("$PULLSPEC:$VCS_BRANCH-$BUILD_DATE-$VCS_REF")
    85           ( IFS=$','; echo "${TAGS[*]}" )
    86  
    87       - name: Build and publish image on quay.io
    88         uses: docker/build-push-action@v2
    89         with:
    90           context: ./operator
    91           file: ./operator/bundle.Dockerfile
    92           push: true
    93           tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}"
    94  
    95   publish-size-calculator:
    96     runs-on: ubuntu-latest
    97     steps:
    98       - uses: actions/checkout@v3
    99  
   100       - name: Set up QEMU
   101         uses: docker/setup-qemu-action@v1
   102  
   103       - name: Set up Docker Buildx
   104         uses: docker/setup-buildx-action@v1
   105  
   106       - name: Login to Quay.io
   107         uses: docker/login-action@v1
   108         with:
   109           registry: quay.io
   110           logout: true
   111           username: ${{ secrets.OPENSHIFT_LOGGING_USER }}
   112           password: ${{ secrets.OPENSHIFT_LOGGING_PASS }}
   113  
   114       - name: Get image tags
   115         id: image_tags
   116         run: |
   117           echo -n ::set-output name=IMAGE_TAGS::
   118           PULLSPEC="$IMAGE_REGISTRY/$IMAGE_ORGANIZATION/$IMAGE_CALCULATOR_NAME"
   119           TAGS=("$PULLSPEC:latest", "$PULLSPEC:v0.0.1")
   120           BUILD_DATE="$(date -u +'%Y-%m-%d')"
   121           VCS_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
   122           VCS_REF="$(git rev-parse --short HEAD)"
   123           TAGS+=("$PULLSPEC:$VCS_BRANCH-$BUILD_DATE-$VCS_REF")
   124           ( IFS=$','; echo "${TAGS[*]}" )
   125  
   126       - name: Build and publish image on quay.io
   127         uses: docker/build-push-action@v2
   128         with:
   129           context: ./operator
   130           file: ./operator/calculator.Dockerfile
   131           push: true
   132           tags: "${{ steps.image_tags.outputs.IMAGE_TAGS }}"