Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
feat: conditions for release push (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
bo0tzz authored Dec 16, 2023
1 parent b748e71 commit cd76329
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ jobs:
uses: tj-actions/changed-files@v40
with:
files: versions.yaml

- name: Determine image push
uses: actions/github-script@v7
id: should-release
with:
script: |
if (context.eventName == "pull_request") return false;
if (context.eventName == "workflow_dispatch") return true;
return "${{ steps.changed-version.outputs.any_changed }}" == "true";
- name: Set major postgres version
id: version
Expand All @@ -83,11 +92,10 @@ jobs:
name=ghcr.io/${{ github.repository_owner }}/cnpgvecto.rs
tags: |
type=ref,event=pr
# TODO: When exactly to push these tags?
type=raw,value=${{ matrix.cnpg }}-${{ matrix.pgvectors }},enable=${{ steps.changed-version.outputs.any_changed == 'true' }}
type=raw,value=${{ steps.version.outputs.pg_major }}-${{ matrix.pgvectors }},enable=${{ steps.changed-version.outputs.any_changed == 'true' }}
type=raw,value=${{ matrix.cnpg }},enable=${{ steps.changed-version.outputs.any_changed == 'true' }}
type=raw,value=${{ steps.version.outputs.pg_major }},enable=${{ steps.changed-version.outputs.any_changed == 'true' }}
type=raw,value=${{ matrix.cnpg }}-${{ matrix.pgvectors }},enable=${{ steps.should-release.outputs.result }}
type=raw,value=${{ steps.version.outputs.pg_major }}-${{ matrix.pgvectors }},enable=${{ steps.should-release.outputs.result }}
type=raw,value=${{ matrix.cnpg }},enable=${{ steps.should-release.outputs.result }}
type=raw,value=${{ steps.version.outputs.pg_major }},enable=${{ steps.should-release.outputs.result }}
- name: Build and push image
uses: docker/[email protected]
Expand Down

0 comments on commit cd76329

Please sign in to comment.