Skip to content

Commit 4a75328

Browse files
author
Dmytro Bondar
authored
chore: workflow updates (#17)
- Pin base image digest - Replace wget by curl - Publish new image on each push to `main` branch - Remove release workflow - Update README
1 parent dbb7962 commit 4a75328

File tree

6 files changed

+17
-58
lines changed

6 files changed

+17
-58
lines changed

.github/renovate.json

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"config:recommended",
5-
":disableDependencyDashboard"
6-
],
3+
"extends": ["config:recommended", ":disableDependencyDashboard"],
74
"automerge": true,
85
"automergeStrategy": "squash",
9-
"enabledManagers": [
10-
"dockerfile",
11-
"github-actions",
12-
"custom.regex"
13-
],
6+
"enabledManagers": ["custom.regex", "dockerfile", "github-actions"],
147
"customManagers": [
158
{
169
"customType": "regex",
17-
"description": "Update sqlcmd version",
10+
"description": ["Update sqlcmd version"],
1811
"datasourceTemplate": "github-releases",
1912
"depNameTemplate": "microsoft/go-sqlcmd",
20-
"fileMatch": [
21-
"^Dockerfile$",
22-
"^version$"
23-
],
24-
"matchStrings": [
25-
"(?:ARG )?SQLCMD_VERSION=(?<currentValue>.+?)\\s"
26-
]
13+
"fileMatch": ["^Dockerfile$"],
14+
"matchStrings": ["ARG SQLCMD_VERSION=(?<currentValue>.+?)\\s"]
2715
}
2816
]
2917
}

.github/workflows/docker.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ name: Docker
77
on:
88
pull_request:
99
branches: [main]
10-
release:
11-
types: [published]
10+
push:
11+
branches: [main]
1212

1313
permissions:
1414
packages: write
@@ -22,14 +22,12 @@ jobs:
2222
- uses: docker/setup-buildx-action@v3
2323

2424
- name: Login to Docker Hub
25-
if: ${{ github.event_name == 'release' }}
2625
uses: docker/login-action@v3
2726
with:
2827
username: ${{ github.repository_owner }}
2928
password: ${{ secrets.DOCKERHUB_TOKEN }}
3029

3130
- name: Login to GitHub Container Registry
32-
if: ${{ github.event_name == 'release' }}
3331
uses: docker/login-action@v3
3432
with:
3533
registry: ghcr.io
@@ -51,4 +49,4 @@ jobs:
5149
tags: ${{ steps.meta.outputs.tags }}
5250
platforms: linux/amd64,linux/arm64,linux/s390x
5351
provenance: false
54-
push: ${{ github.event_name == 'release' }}
52+
push: ${{ github.event_name == 'push' }}

.github/workflows/release.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
FROM --platform=${BUILDPLATFORM} alpine:3 AS tools
22
ARG SQLCMD_VERSION=v1.8.0
33
ARG TARGETARCH
4-
RUN apk add jq --no-cache && \
5-
wget -c -O - $(wget -q -O - https://api.github.com/repos/microsoft/go-sqlcmd/releases/tags/${SQLCMD_VERSION} \
6-
| jq -r --arg arch "${TARGETARCH}" '.assets[] | select(.name | test(".*linux.*" + $arch + ".*")).browser_download_url' ) \
4+
RUN apk add --update-cache --no-cache curl jq xz && \
5+
curl -sSL $(curl -sSL "https://api.github.com/repos/microsoft/go-sqlcmd/releases/tags/${SQLCMD_VERSION}" | \
6+
jq -r --arg arch "${TARGETARCH}" '.assets[] | select(.name | test(".*linux.*" + $arch + ".*")).browser_download_url') \
77
| tar -xj
88

9-
FROM gcr.io/distroless/static:nonroot
9+
FROM gcr.io/distroless/static:nonroot@sha256:3a03fc0826340c7deb82d4755ca391bef5adcedb8892e58412e1a6008199fa91
1010
COPY --from=tools /sqlcmd /sqlcmd
1111
USER nonroot:nonroot
1212
ENTRYPOINT ["/sqlcmd"]

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# [go-sqlcmd](https://github.com/microsoft/go-sqlcmd) docker image
22

3-
[![Docker](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml/badge.svg?event=release)](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml)
4-
![Docker Image Size](https://img.shields.io/docker/image-size/bonddim/go-sqlcmd)
5-
[![Docker Pulls](https://img.shields.io/docker/pulls/bonddim/go-sqlcmd)](https://hub.docker.com/r/bonddim/go-sqlcmd)
6-
[![GitHub Release](https://img.shields.io/github/v/release/bonddim/go-sqlcmd)](https://github.com/bonddim/go-sqlcmd/releases/latest)
3+
[docker-hub]: https://hub.docker.com/r/bonddim/go-sqlcmd
4+
[![Docker](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml/badge.svg)](https://github.com/bonddim/go-sqlcmd/actions/workflows/docker.yaml)
5+
[![Docker Image Version](https://img.shields.io/docker/v/bonddim/go-sqlcmd)][docker-hub]
6+
[![Docker Image Size](https://img.shields.io/docker/image-size/bonddim/go-sqlcmd)][docker-hub]
7+
[![Docker Pulls](https://img.shields.io/docker/pulls/bonddim/go-sqlcmd)][docker-hub]
78
[![GitHub License](https://img.shields.io/github/license/bonddim/go-sqlcmd)](https://github.com/bonddim/go-sqlcmd?tab=MIT-1-ov-file)
89

910
## About

version

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)