diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cf8ea1d..5d68e09 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -17,19 +17,26 @@ permissions: packages: write jobs: + configure: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.get-versions.outputs.result }} + steps: + - name: Checkout to repository + uses: actions/checkout@v3 + - name: Get dependency versions + uses: mikefarah/yq@v4.9.8 + id: get-versions + with: + cmd: yq eval -j -I=0 versions.yaml + build_and_push: runs-on: ubuntu-latest + needs: configure strategy: # Prevent a failure in one image from stopping the other builds fail-fast: false - matrix: - # TODO: Get Renovate to update these - cnpgTag: - - "14.10" - - "15.5" - - "16.1" - pgvectorsVersion: - - "v0.1.11" + matrix: ${{ fromJson(needs.configure.outputs.matrix) }} steps: # Setup @@ -54,7 +61,7 @@ jobs: - name: Set major postgres version id: version run: | - pg_major=$(echo ${{ matrix.cnpgTag }} | cut -d'.' -f1) + pg_major=$(echo ${{ matrix.cnpg }} | cut -d'.' -f1) echo "pg_major=$pg_major" >> "$GITHUB_OUTPUT" - name: Generate docker image tags @@ -69,9 +76,9 @@ jobs: tags: | type=ref,event=pr # TODO: When exactly to push these tags? - type=raw,value=${{ matrix.cnpgTag }}-${{ matrix.pgvectorsVersion }} - type=raw,value=${{ steps.version.outputs.pg_major }}-${{ matrix.pgvectorsVersion }} - type=raw,value=${{ matrix.cnpgTag }} + type=raw,value=${{ matrix.cnpg }}-${{ matrix.pgvectors }} + type=raw,value=${{ steps.version.outputs.pg_major }}-${{ matrix.pgvectors }} + type=raw,value=${{ matrix.cnpg }} type=raw,value=${{ steps.version.outputs.pg_major }} - name: Build and push image @@ -85,5 +92,5 @@ jobs: tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} build-args: | - CNPG_TAG=${{ matrix.cnpgTag }} - PGVECTORS_TAG=${{ matrix.pgvectorsVersion }} + CNPG_TAG=${{ matrix.cnpg }} + PGVECTORS_TAG=${{ matrix.pgvectors }} diff --git a/versions.yaml b/versions.yaml new file mode 100644 index 0000000..0239c94 --- /dev/null +++ b/versions.yaml @@ -0,0 +1,7 @@ +cnpg: + # This is a comment + - "14.10" + - "15.5" + - "16.1" +pgvectors: + - "v0.1.11" \ No newline at end of file