workflows: build trunk-test-tembo for more Pg versions #165
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trunk test images | |
defaults: | |
run: | |
shell: bash | |
working-directory: ./images/trunk-test-tembo/ | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- "images/trunk-test-tembo/**" | |
- ".github/workflows/test-images.yml" | |
pull_request: | |
branches: | |
- 'main' | |
paths: | |
- "images/trunk-test-tembo/**" | |
- ".github/workflows/test-images.yml" | |
jobs: | |
build_trunk_test_image: | |
name: Build image used for trunk tests | |
runs-on: | |
- self-hosted | |
- dind | |
- large-8x8 | |
strategy: | |
matrix: | |
pg_version: ["14", "15", "16"] | |
outputs: | |
short_sha: ${{ steps.versions.outputs.SHORT_SHA }} | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set version strings | |
id: versions | |
run: | | |
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Build and tag image | |
run: | | |
set -xe | |
docker build --build-arg PG_VERSION=${{ matrix.pg_version }} -t trunk-test-tembo:pg${{ matrix.pg_version }} . | |
docker tag trunk-test-tembo:pg${{ matrix.pg_version }} trunk-test-tembo:latest | |
docker tag trunk-test-tembo:pg${{ matrix.pg_version }} trunk-test-tembo:${{ steps.versions.outputs.SHORT_SHA }}-pg${{ matrix.pg_version }} | |
- name: Login to Quay | |
if: ${{ github.ref == 'refs/heads/main' }} | |
uses: docker/login-action@v2 | |
with: | |
registry: quay.io/tembo | |
username: ${{ secrets.QUAY_USER_TEMBO }} | |
password: ${{ secrets.QUAY_PASSWORD_TEMBO }} | |
- name: Push to Quay | |
if: ${{ github.ref == 'refs/heads/main' }} | |
shell: bash | |
run: | | |
set -xe | |
IFS=' ' read -ra TAG_ARRAY <<< "latest ${{ steps.versions.outputs.SHORT_SHA }}" | |
for tag in "${TAG_ARRAY[@]}"; do | |
docker tag trunk-test-tembo:$tag quay.io/tembo/trunk-test-tembo:$tag | |
docker push quay.io/tembo/trunk-test-tembo:$tag | |
done |