diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml index ac65bb8bc9c..bd23714c549 100644 --- a/.github/workflows/docker-cd.yml +++ b/.github/workflows/docker-cd.yml @@ -24,14 +24,27 @@ name: Docker Image CI and CD on: schedule: - - cron: '30 1 * * *' # everyday at 1:30 PM UTC + cron: '30 1 * * *' # everyday at 1:30 PM UTC + paths-ignore: + - 'docs/**' + - '*.md' + - '*.html' + - 'src/test/**' + - 'src/assembly/**' + - 'dev/**' workflow_dispatch: - jobs: - - build: + build-nightly: runs-on: ubuntu-latest + strategy: + matrix: + include: + - image-pattern: nightly + docker-file: sysds.Dockerfile + include: + - image-pattern: python-nightly + docker-file: pythonsysds.Dockerfile steps: - name: Checkout @@ -43,28 +56,14 @@ jobs: with: images: apache/systemds tags: | - type=schedule,pattern=nightly + type=schedule,pattern=${{image-pattern}} # https://github.com/docker/setup-buildx-action - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 - -## Uncomment the following to inspect buildx build -# -# - name: Inspect builder -# run: | -# echo "Name: ${{ steps.buildx.outputs.name }}" -# echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" -# echo "Status: ${{ steps.buildx.outputs.status }}" -# echo "Flags: ${{ steps.buildx.outputs.flags }}" -# echo "Platforms: ${{ steps.buildx.outputs.platforms }}" - # IMPORTANT: The credentials should not be available via the - # Pull request, hence this if condition here. - # github.event_name != 'pull_request' - name: Login to DockerHub -# if: github.event_name != 'pull_request' uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USER }} @@ -76,7 +75,7 @@ jobs: uses: docker/build-push-action@v2 with: context: . - file: ./docker/sysds.Dockerfile + file: ./docker/${{docker-file}} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker-testImage.yml b/.github/workflows/docker-testImage.yml new file mode 100644 index 00000000000..0286204ff69 --- /dev/null +++ b/.github/workflows/docker-testImage.yml @@ -0,0 +1,71 @@ +#------------------------------------------------------------- +# +# 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 Image CI and CD + +# This job only tricker if requested in github. +on: + workflow_dispatch: + +jobs: + build-test-image: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - image-pattern: testing-latest + docker-file: testsysds.Dockerfile + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Configure Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: apache/systemds + tags: | + type=schedule,pattern=${{image-pattern}} + + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # https://github.com/docker/build-push-action + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: . + file: ./docker/${{docker-file}} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} +