release image_tag:14.7.2-pgvector-v0.8.0 pg_version:14 #32
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: RELEASE-IMAGE | |
on: | |
workflow_dispatch: | |
inputs: | |
image_tag: | |
description: 'The tag name of image' | |
required: true | |
default: '' | |
pg_version: | |
description: 'The version of postgres' | |
required: true | |
release: | |
types: | |
- published | |
env: | |
RELEASE_VERSION: ${{ github.ref_name }} | |
IMAGE_NAME: "apecloud/spilo" | |
DOCKER_USER: ${{ secrets.DOCKER_REGISTRY_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
ALIYUN_USER: ${{ secrets.ALIYUN_REGISTRY_USER }} | |
ALIYUN_PASSWORD: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }} | |
ALIYUN_USER_NEW: ${{ secrets.ALIYUN_USER_NEW }} | |
ALIYUN_PASSWORD_NEW: ${{ secrets.ALIYUN_PASSWORD_NEW }} | |
run-name: release image_tag:${{ inputs.image_tag }} pg_version:${{ inputs.pg_version }} | |
jobs: | |
image-tag: | |
runs-on: ubuntu-22.04 | |
outputs: | |
tag-name: ${{ steps.get_tag_name.outputs.tag_name }} | |
steps: | |
- name: Get Tag Name | |
id: get_tag_name | |
run: | | |
TAG_NAME=${{ inputs.image_tag }} | |
#if [ -z "$TAG_NAME" ]; then | |
# TAG_NAME=${{ env.RELEASE_VERSION }} | |
#fi | |
#TAG_NAME="${TAG_NAME/v/}" | |
echo tag_name=$TAG_NAME >> $GITHUB_OUTPUT | |
release-image: | |
needs: image-tag | |
name: Push ${{ matrix.registry }} | |
strategy: | |
fail-fast: false | |
matrix: | |
registry: [ docker.io, apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com, infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com ] | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: 'read' | |
packages: 'write' | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up packages | |
run: sudo apt-get install -y docker-compose | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Derive spilo image name | |
id: image | |
working-directory: postgres-appliance | |
run: | | |
IMAGE="${{ matrix.registry }}/${{ env.IMAGE_NAME }}:${{ needs.image-tag.outputs.tag-name }}" | |
echo "NAME=$IMAGE" >> $GITHUB_OUTPUT | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- if: ${{ contains(matrix.registry, 'docker') }} | |
name: Login to ${{ matrix.registry }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ matrix.registry }} | |
username: ${{ env.DOCKER_USER }} | |
password: ${{ env.DOCKER_PASSWORD }} | |
- if: ${{ contains(matrix.registry, 'aliyuncs') && ! contains(matrix.registry, 'infracreate') }} | |
name: Login to ${{ matrix.registry }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ matrix.registry }} | |
username: ${{ env.ALIYUN_USER }} | |
password: ${{ env.ALIYUN_PASSWORD }} | |
- if: ${{ contains(matrix.registry, 'aliyuncs') && contains(matrix.registry, 'infracreate') }} | |
name: Login to ${{ matrix.registry }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ matrix.registry }} | |
username: ${{ env.ALIYUN_USER_NEW }} | |
password: ${{ env.ALIYUN_PASSWORD_NEW }} | |
- name: Build and export to local docker for testing | |
uses: docker/build-push-action@v6 | |
with: | |
context: "postgres-appliance/" | |
load: true | |
tags: ${{ steps.image.outputs.NAME }} | |
build-args: | | |
PGVERSION=${{ inputs.pg_version }} | |
PGOLDVERSIONS=${{ inputs.pg_old_versions }} | |
- name: Test spilo docker image | |
continue-on-error: true | |
env: | |
SPILO_TEST_IMAGE: "${{ steps.image.outputs.NAME }}" | |
run: | | |
bash postgres-appliance/tests/test_spilo.sh | |
- name: Build arm64 additionally and push multi-arch image to ${{ matrix.registry }} | |
uses: docker/build-push-action@v6 | |
with: | |
context: "postgres-appliance/" | |
push: true | |
tags: "${{ steps.image.outputs.NAME }}" | |
platforms: linux/amd64,linux/arm64 | |
build-args: | | |
PGVERSION=${{ inputs.pg_version }} | |
PGOLDVERSIONS= |