| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| |
| name: Docker |
| |
| on: |
| workflow_dispatch: |
| inputs: |
| image_repo: |
| description: 'image repository' |
| required: true |
| default: teaclave |
| |
| jobs: |
| ubuntu-2004-sgx: |
| runs-on: ubuntu-latest |
| permissions: |
| packages: write |
| contents: read |
| |
| steps: |
| - uses: actions/checkout@v3 |
| |
| - name: Log in to registry |
| # This is where you will update the personal access token to GITHUB_TOKEN |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin |
| |
| - name: Build and push image |
| run: | |
| IMAGE_ID=ubuntu-2004-sgx-2.17.1 |
| IMAGE_NAME=ghcr.io/${{ github.event.inputs.image_repo }}/teaclave-build-$IMAGE_ID |
| |
| # Change all uppercase to lowercase |
| IMAGE_NAME=$(echo $IMAGE_NAME | tr '[A-Z]' '[a-z]') |
| # Strip git ref prefix from version |
| VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') |
| # Strip "v" prefix from tag name |
| [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') |
| # Use Docker `latest` tag convention |
| [ "$VERSION" == "master" ] && VERSION=latest |
| echo IMAGE_NAME=$IMAGE_NAME |
| echo VERSION=$VERSION |
| |
| # build image |
| cd docker && docker build . --file build.$IMAGE_ID.Dockerfile --tag $IMAGE_NAME:$VERSION --label "runnumber=${GITHUB_RUN_ID}" |
| |
| docker push $IMAGE_NAME:$VERSION |
| |
| ubuntu-1804-sgx: |
| runs-on: ubuntu-latest |
| permissions: |
| packages: write |
| contents: read |
| |
| steps: |
| - uses: actions/checkout@v3 |
| |
| - name: Log in to registry |
| # This is where you will update the personal access token to GITHUB_TOKEN |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin |
| |
| - name: Build and push image |
| run: | |
| IMAGE_ID=ubuntu-1804-sgx-2.17.1 |
| IMAGE_NAME=ghcr.io/${{ github.event.inputs.image_repo }}/teaclave-build-$IMAGE_ID |
| |
| # Change all uppercase to lowercase |
| IMAGE_NAME=$(echo $IMAGE_NAME | tr '[A-Z]' '[a-z]') |
| # Strip git ref prefix from version |
| VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') |
| # Strip "v" prefix from tag name |
| [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') |
| # Use Docker `latest` tag convention |
| [ "$VERSION" == "master" ] && VERSION=latest |
| echo IMAGE_NAME=$IMAGE_NAME |
| echo VERSION=$VERSION |
| |
| # build image |
| cd docker && docker build . --file build.$IMAGE_ID.Dockerfile --tag $IMAGE_NAME:$VERSION --label "runnumber=${GITHUB_RUN_ID}" |
| |
| docker push $IMAGE_NAME:$VERSION |
| |
| ubuntu-2004-dcap: |
| runs-on: ubuntu-latest |
| permissions: |
| packages: write |
| contents: read |
| |
| steps: |
| - uses: actions/checkout@v3 |
| |
| - name: Log in to registry |
| # This is where you will update the personal access token to GITHUB_TOKEN |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin |
| |
| - name: Build and push image |
| run: | |
| IMAGE_ID=ubuntu-2004-sgx-dcap-1.14 |
| IMAGE_NAME=ghcr.io/${{ github.event.inputs.image_repo }}/teaclave-build-$IMAGE_ID |
| |
| # Change all uppercase to lowercase |
| IMAGE_NAME=$(echo $IMAGE_NAME | tr '[A-Z]' '[a-z]') |
| # Strip git ref prefix from version |
| VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') |
| # Strip "v" prefix from tag name |
| [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') |
| # Use Docker `latest` tag convention |
| [ "$VERSION" == "master" ] && VERSION=latest |
| echo IMAGE_NAME=$IMAGE_NAME |
| echo VERSION=$VERSION |
| |
| # build image |
| cd docker && docker build . --file build.$IMAGE_ID.Dockerfile --tag $IMAGE_NAME:$VERSION --label "runnumber=${GITHUB_RUN_ID}" |
| |
| docker push $IMAGE_NAME:$VERSION |
| |
| ubuntu-1804-dcap: |
| runs-on: ubuntu-latest |
| permissions: |
| packages: write |
| contents: read |
| |
| steps: |
| - uses: actions/checkout@v3 |
| |
| - name: Log in to registry |
| # This is where you will update the personal access token to GITHUB_TOKEN |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin |
| |
| - name: Build and push image |
| run: | |
| IMAGE_ID=ubuntu-1804-sgx-dcap-1.14 |
| IMAGE_NAME=ghcr.io/${{ github.event.inputs.image_repo }}/teaclave-build-$IMAGE_ID |
| |
| # Change all uppercase to lowercase |
| IMAGE_NAME=$(echo $IMAGE_NAME | tr '[A-Z]' '[a-z]') |
| # Strip git ref prefix from version |
| VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') |
| # Strip "v" prefix from tag name |
| [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') |
| # Use Docker `latest` tag convention |
| [ "$VERSION" == "master" ] && VERSION=latest |
| echo IMAGE_NAME=$IMAGE_NAME |
| echo VERSION=$VERSION |
| |
| # build image |
| cd docker && docker build . --file build.$IMAGE_ID.Dockerfile --tag $IMAGE_NAME:$VERSION --label "runnumber=${GITHUB_RUN_ID}" |
| |
| docker push $IMAGE_NAME:$VERSION |