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

Commit

Permalink
chore(ci): Only push release tags when versions change
Browse files Browse the repository at this point in the history
  • Loading branch information
bo0tzz committed Dec 9, 2023
1 parent 181e6b5 commit 9e3f7d3
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 @@ -43,6 +43,8 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up QEMU
uses: docker/[email protected]
Expand All @@ -58,6 +60,12 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine version change
id: changed-version
uses: tj-actions/changed-files@v40
with:
files: versions.yaml

- name: Set major postgres version
id: version
run: |
Expand All @@ -76,17 +84,17 @@ jobs:
tags: |
type=ref,event=pr
# TODO: When exactly to push these tags?
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 }}
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' }}
- name: Build and push image
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ !github.event.pull_request }}
push: ${{ !github.event.pull_request.head.repo.fork && steps.metadata.outputs.tags != '' }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.metadata.outputs.tags }}
Expand Down

0 comments on commit 9e3f7d3

Please sign in to comment.