|
| 1 | + # Copyright (C) 2023 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>) |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +# |
| 15 | +# SPDX-License-Identifier: Apache-2.0 |
| 16 | +# License-Filename: LICENSE |
| 17 | + |
| 18 | +name: Extended Image |
| 19 | + |
| 20 | +on: |
| 21 | + workflow_dispatch: |
| 22 | + pull_request: |
| 23 | + branches: |
| 24 | + - main |
| 25 | + push: |
| 26 | + branches: |
| 27 | + - main |
| 28 | + workflow_run: |
| 29 | + workflows: |
| 30 | + - 'Haskell Image' |
| 31 | + types: |
| 32 | + - completed |
| 33 | + |
| 34 | +env: |
| 35 | + REGISTRY: ghcr.io |
| 36 | + |
| 37 | +permissions: write-all |
| 38 | + |
| 39 | +jobs: |
| 40 | + build: |
| 41 | + name: Build ORT Extended Image |
| 42 | + runs-on: ubuntu-22.04 |
| 43 | + permissions: |
| 44 | + contents: read |
| 45 | + packages: write |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Checkout default branch |
| 49 | + uses: actions/checkout@v3 |
| 50 | + |
| 51 | + - name: Set up Docker Buildx |
| 52 | + uses: docker/setup-buildx-action@v2 |
| 53 | + |
| 54 | + - name: Login to GitHub Container Registry |
| 55 | + uses: docker/login-action@v2 |
| 56 | + with: |
| 57 | + registry: ${{ env.REGISTRY }} |
| 58 | + username: ${{ github.actor }} |
| 59 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + |
| 61 | + - name: Extract components metadata (tags, labels) for Ort runtime image |
| 62 | + id: meta-ort |
| 63 | + uses: docker/metadata-action@v4 |
| 64 | + with: |
| 65 | + images: | |
| 66 | + ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended |
| 67 | + tags: | |
| 68 | + type=raw,sha,enable=true,format=short |
| 69 | +
|
| 70 | + - name: Build ORT runtime container |
| 71 | + uses: docker/build-push-action@v4 |
| 72 | + with: |
| 73 | + context: . |
| 74 | + file: Dockerfile-extended |
| 75 | + push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} |
| 76 | + load: false |
| 77 | + tags: | |
| 78 | + ${{ steps.meta-ort.outputs.tags }} |
| 79 | + ${{ env.REGISTRY }}/${{ github.repository_owner }}/ort-extended:latest |
| 80 | + labels: ${{ steps.meta.outputs.labels }} |
| 81 | + build-contexts: | |
| 82 | + android=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/android:latest |
| 83 | + swift=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/swift:latest |
| 84 | + sbt=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/sbt:latest |
| 85 | + dart=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/dart:latest |
| 86 | + dotnet=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/dotnet:latest |
| 87 | + haskell=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/haskell:latest |
| 88 | + dotnet=docker-image://${{ env.REGISTRY }}/${{ github.repository }}/dotnet:latest |
0 commit comments