From c6e7f2e7d264cc33eb18ebe412bcc94b29882ca6 Mon Sep 17 00:00:00 2001 From: Marlon Saglia Date: Thu, 15 Aug 2024 12:02:18 +0200 Subject: [PATCH] Migrate workflow "systemtest-base-el8" to Github Actions This commit adds a new GitHub Actions workflow to build the Vespa systemtest base Docker image for CentOS 8. The workflow is triggered on pushes to the main branch and pull requests targeting the main branch, and it builds and pushes the Docker image to Docker Hub. image. feat(ci): Schedule container image build in weekly cron --- .github/workflows/build-container-images.yml | 60 ++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build-container-images.yml diff --git a/.github/workflows/build-container-images.yml b/.github/workflows/build-container-images.yml new file mode 100644 index 000000000..5179ac8d0 --- /dev/null +++ b/.github/workflows/build-container-images.yml @@ -0,0 +1,60 @@ +name: Build Container Images + +on: + push: + branches: + - master + paths: + - ".github/workflows/build-container-images.yml" + - "docker/**" + + pull_request: + branches: + - master + paths: + - ".github/workflows/build-container-images.yml" + - "docker/**" + + schedule: + - cron: "0 4 * * 1" + +jobs: + systemtest-base-el8: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + if: ${{ github.event_name != 'pull_request' }} + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: docker.io/vespaengine/vespa-systemtest-base-el8:latest + tags: | + type=ref,event=branch + # set "latest" tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: docker/ + file: docker/Dockerfile.base + build-args: | + BASE_IMAGE=docker.io/almalinux:8 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}