Skip to content

Commit 021de21

Browse files
authored
Merge pull request #46 from arnested/new-docker-build-and-push-action
Update docker build and push action to v2 syntax
2 parents e8004ca + a169a3a commit 021de21

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/docker-build.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/[email protected]
10-
- name: Build and push Docker images
11-
uses: docker/build-push-action@v2
10+
- name: Set up Docker Buildx
11+
id: buildx
12+
uses: docker/setup-buildx-action@master
13+
- name: Login to DockerHub
14+
if: github.ref == 'refs/heads/master'
15+
uses: docker/login-action@v1
1216
with:
1317
username: ${{ secrets.DOCKER_USERNAME }}
1418
password: ${{ secrets.DOCKER_TOKEN }}
15-
# Assume the same repo name on Docker Hub as on GitHub
16-
repository: ${{ github.repository }}
17-
tag_with_ref: true
18-
add_git_labels: true
19+
- name: Build and push Docker images
20+
if: github.ref == 'refs/heads/master'
21+
uses: docker/build-push-action@v2
22+
with:
23+
builder: ${{ steps.buildx.outputs.name }}
24+
tags: ${{ github.repository }}:latest
25+
push: true

0 commit comments

Comments
 (0)