Skip to content

Commit aeb6fd9

Browse files
committed
publish docker image with official actions
1 parent 390cacf commit aeb6fd9

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

.github/workflows/docker-publish.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,32 @@ on:
1010
- created
1111

1212
jobs:
13-
publish:
13+
docker:
14+
runs-on: ubuntu-latest
1415
steps:
15-
- name: Publish image
16-
uses: mr-smithers-excellent/docker-build-push@v5
17-
with:
18-
image: p1c2u/openapi-spec-validator
19-
registry: docker.io
20-
username: ${{ secrets.DOCKER_USERNAME }}
21-
password: ${{ secrets.DOCKER_PASSWORD }}
16+
- uses: actions/checkout@v2
17+
- name: Docker meta
18+
id: docker_meta
19+
uses: crazy-max/ghaction-docker-meta@v1
20+
with:
21+
images: |
22+
p1c2u/openapi-spec-validator
23+
tag-semver: |
24+
{{version}}
25+
- name: Set up QEMU
26+
uses: docker/setup-qemu-action@v1
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v1
29+
- name: Login to DockerHub
30+
if: github.event_name != 'pull_request'
31+
uses: docker/login-action@v1
32+
with:
33+
username: ${{ secrets.DOCKERHUB_USERNAME }}
34+
password: ${{ secrets.DOCKERHUB_TOKEN }}
35+
- name: Build and push
36+
uses: docker/build-push-action@v2
37+
with:
38+
context: .
39+
push: ${{ github.event_name != 'pull_request' }}
40+
tags: ${{ steps.docker_meta.outputs.tags }}
41+
labels: ${{ steps.docker_meta.outputs.labels }}

0 commit comments

Comments
 (0)