| # 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: Container ghcr.io/apache/trafficcontrol/ci/trafficserver-alpine |
| |
| env: |
| DOCKER_BUILDKIT: '1' |
| COMPOSE_DOCKER_CLI_BUILD: '1' |
| CONTAINER: ghcr.io/${{ github.repository }}/ci/trafficserver-alpine |
| |
| on: |
| workflow_dispatch: # run manually |
| push: |
| paths: |
| - .env |
| - .github/containers/trafficserver-alpine/** |
| - .github/workflows/containers/trafficserver-alpine.yml |
| pull_request: |
| paths: |
| - .env |
| - .github/containers/trafficserver-alpine/** |
| - .github/workflows/containers/trafficserver-alpine.yml |
| types: [ opened, reopened, ready_for_review, synchronize ] |
| |
| jobs: |
| build: |
| if: ${{ github.repository_owner == 'apache' || github.event_name == 'workflow_dispatch' }} |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout repo |
| uses: actions/checkout@master |
| - name: Load environment |
| run: cp .env "${{ github.env }}" |
| - name: Build ${{ env.CONTAINER }}:${{ env.ATS_VERSION }} |
| working-directory: .github/containers/trafficserver-alpine |
| run: docker-compose build |
| - name: docker login ghcr.io |
| uses: docker/login-action@v1 |
| with: |
| registry: ghcr.io |
| username: ${{ github.repository_owner }} |
| password: ${{ secrets.GITHUB_TOKEN }} |
| - name: Push ${{ env.CONTAINER }}:${{ env.ATS_VERSION }} |
| if: ${{ github.event_name != 'pull_request' }} |
| working-directory: .github/containers/trafficserver-alpine |
| run: docker-compose push |