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 17ac100
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 32 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build-container-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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 }}
platforms: linux/amd64,linux/arm64
cache-to: type=gha,mode=max
32 changes: 0 additions & 32 deletions screwdriver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,3 @@ jobs:
cd ${RUBYLIB}
ruby test/testrunner.rb
exit $?
systemtest-base-el8:
requires: [~pr, ~commit]
sourcePaths: ["docker/"]
annotations:
screwdriver.cd/cpu: HIGH
screwdriver.cd/ram: HIGH
screwdriver.cd/timeout: 30
screwdriver.cd/buildPeriodically: H 4 * * 1
screwdriver.cd/dockerEnabled: true
screwdriver.cd/dockerCpu: TURBO
screwdriver.cd/dockerRam: TURBO
secrets:
- DOCKER_HUB_DEPLOY_KEY
steps:
- install-docker-cli: |
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf -y install docker-ce docker-ce-cli containerd.io
docker system info
- build: |
cd docker
docker build --file Dockerfile.base \
--build-arg BASE_IMAGE=docker.io/almalinux:8 \
--tag docker.io/vespaengine/vespa-systemtest-base-el8:latest .
- publish: |
if [[ -z "$SD_PULL_REQUEST" ]]; then
OPT_STATE="$(set +o)"
set +x
docker login --username aressem --password "$DOCKER_HUB_DEPLOY_KEY"
eval "$OPT_STATE"
docker push docker.io/vespaengine/vespa-systemtest-base-el8:latest
fi

0 comments on commit 17ac100

Please sign in to comment.