Skip to content

Commit ec46941

Browse files
authored
Upgrade to v2 of the Docker GitHub action (#784)
* Upgrade to v2 of the Docker GitHub action * Add context and file * Fix build args * cleanup
1 parent e0e6c1f commit ec46941

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
name: docker
2-
32
on:
43
push:
54
branches:
65
- master
7-
86
jobs:
9-
107
docker:
118
name: push kjconroy/sqlc:devel
129
runs-on: ubuntu-latest
1310
steps:
11+
- name: Set created date
12+
id: prep
13+
run: |
14+
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
1415
- uses: actions/checkout@v2
15-
- uses: docker/build-push-action@v2.1.0
16+
- uses: docker/setup-buildx-action@v1
17+
- uses: docker/login-action@v1
1618
with:
1719
username: kjconroy
1820
password: ${{ secrets.DOCKER_PASSWORD }}
19-
build_args: github_ref=${{ github.ref }},github_sha=${{ github.sha }}
20-
repository: kjconroy/sqlc
21-
add_git_labels: true
22-
tags: devel
21+
- uses: docker/build-push-action@v2
22+
with:
23+
context: .
24+
file: ./Dockerfile
25+
build-args: |
26+
github_ref=${{ github.ref }}
27+
github_sha=${{ github.sha }}
28+
tags: kjconroy/sqlc:devel
29+
labels: |
30+
org.opencontainers.image.source=${{ github.event.repository.html_url }}
31+
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
32+
org.opencontainers.image.revision=${{ github.sha }}

0 commit comments

Comments
 (0)