upgrade pgtap to 1.3.1 #60
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: Main Workflow | |
on: | |
push: | |
paths: | |
- '!**' | |
- 'Dockerfile' | |
- '.github/workflows/*.yml' | |
- 'docker-entrypoint-initdb.d/**' | |
branches: | |
- master | |
pull_request: | |
paths: | |
- '!**' | |
- 'Dockerfile' | |
- '.github/workflows/*.yml' | |
- 'docker-entrypoint-initdb.d/**' | |
branches: | |
- '**' | |
schedule: | |
- cron: "0 0 1 * *" | |
jobs: | |
container-build: | |
name: Container Image Build (${{ matrix.pgtap-version }}, ${{ matrix.pg-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pgtap-version: [1.3.1] | |
pg-version: [9, 10, 11, 12, 13, 14, 15, 16, alpine] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Configure Environment | |
shell: bash | |
run: | | |
export IMAGE_NAME=pgtap | |
export IMAGE_TAG=${{ matrix.pgtap-version }}-pg${{ matrix.pg-version }} | |
echo "IMAGE_NAME=${IMAGE_NAME}" >> "$GITHUB_ENV" | |
echo "IMAGE_TAG=${IMAGE_TAG}" >> "$GITHUB_ENV" | |
echo "IMAGE=${IMAGE_NAME}:${IMAGE_TAG}" >> "$GITHUB_ENV" | |
echo "BUILD_IMAGE=quay.io/twyla-ai/${IMAGE_NAME}" >> "$GITHUB_ENV" | |
- name: Build Image | |
shell: bash | |
run: | | |
docker build \ | |
--build-arg "PGTAP_VERSION=${{ matrix.pgtap-version }}" \ | |
--build-arg "PG_CONTAINER_VERSION=${{ matrix.pg-version }}" \ | |
-t ${BUILD_IMAGE} . | |
- name: Test Image | |
shell: bash | |
run: | | |
pushd ./examples | |
docker-compose up --renew-anon-volumes --abort-on-container-exit tests | |
popd | |
- name: Docker Login | |
if: github.ref == 'refs/heads/master' | |
run: | | |
docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} docker.pkg.github.com | |
docker login -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} quay.io | |
- name: Publish Tagged Image | |
if: ${{ github.ref == 'refs/heads/master' && matrix.pg-version != 'alpine' }} | |
shell: bash | |
run: | | |
for i in docker.pkg.github.com/${GITHUB_REPOSITORY} quay.io/twyla-ai; do | |
docker tag ${BUILD_IMAGE} ${i}/${IMAGE} | |
docker image push ${i}/${IMAGE} | |
done | |
- name: Publish Latest Image | |
if: ${{ github.ref == 'refs/heads/master' && matrix.pg-version == 'alpine' }} | |
shell: bash | |
run: | | |
for i in docker.pkg.github.com/${GITHUB_REPOSITORY} quay.io/twyla-ai; do | |
docker tag ${BUILD_IMAGE} ${i}/${IMAGE_NAME}:latest | |
docker image push ${i}/${IMAGE_NAME}:latest | |
done |