Skip to content

Commit

Permalink
Migrate workflow "systemtest-base-el8" to Github Actions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
esolitos authored and gitbutler-client committed Aug 15, 2024
1 parent 356fe9d commit 1aecf59
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build-container-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Container Images

on:
push:
paths:
- ".github/workflows/build-container-images.yml"
- "docker/**"

pull_request:
branches:
- main
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
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: |
# tag container image with branch name and pr number
type=ref,event=branch
type=ref,event=pr
# set "latest" tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push
uses: docker/build-push-action@v
with:
context: docker/
file: 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 }}

0 comments on commit 1aecf59

Please sign in to comment.