-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.1 KB
/
publish-container.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Build and Publish Container
on:
workflow_dispatch:
push:
branches: ["main"]
permissions:
actions: read
contents: read
packages: write
security-events: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Determine Version
id: version
shell: bash
run: echo "sqlcmd=$(gh release view -R microsoft/go-sqlcmd --json tagName -q '.tagName')" >> $GITHUB_OUTPUT
- name: Download sqlcmd ${{ steps.version.outputs.sqlcmd }}
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download ${{ steps.version.outputs.sqlcmd }} --pattern sqlcmd-linux-amd64.tar.bz2 -R microsoft/go-sqlcmd
tar -xjvf sqlcmd-linux-amd64.tar.bz2
- name: "Build and Publish brocksolutions/sqlcmd:${{ steps.version.outputs.sqlcmd }}"
uses: brocksolutions/action-build-container@v3
with:
dockerfile-path: Dockerfile
image-name: sqlcmd
version: ${{ steps.version.outputs.sqlcmd }}
tag-latest: true
push-to-registry: true