diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index b0af73d..0213d3f 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -1,7 +1,6 @@ name: Build and Publish Artifacts on: - pull_request: null push: branches: - main @@ -14,7 +13,7 @@ env: jobs: charts: - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest permissions: contents: read @@ -26,17 +25,20 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - id: version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" - uses: appany/helm-oci-chart-releaser@v0.5.0 if: ${{ github.event_name != 'pull_request' }} with: name: postgrest - tag: 0.2.4 + tag: ${{ steps.version.outputs.VERSION }} repository: ${{ github.repository }} registry: ${{ env.REGISTRY }} registry_username: ${{ github.actor }} registry_password: ${{ secrets.GITHUB_TOKEN }} update_dependencies: 'true' images: + if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest permissions: contents: read @@ -59,6 +61,9 @@ jobs: id: metadata with: images: ${{ env.REGISTRY }}/${{ env.GOOSE_IMAGE_NAME }} + tags: | + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{version}} - uses: docker/build-push-action@v6 id: goose-image with: diff --git a/images/goose.dockerfile b/images/goose.dockerfile index 84f10c8..fa93cce 100644 --- a/images/goose.dockerfile +++ b/images/goose.dockerfile @@ -18,6 +18,7 @@ RUN go mod tidy && go build -ldflags="-s -w" -tags='no_sqlite no_clickhouse no_m FROM scratch +COPY --from=builder /etc/group /etc/group COPY --from=builder /etc/passwd /etc/passwd USER goose