Skip to content

Commit 51b791d

Browse files
authored
Merge pull request #108 from p1c2u/feature/docker-publish-github-action
Docker publish github action
2 parents 0a6baec + aeb6fd9 commit 51b791d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/docker-publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will upload Docker image when a release is created
2+
# For more information see: https://github.com/marketplace/actions/docker-build-push-action
3+
4+
name: Publish docker image
5+
6+
on:
7+
workflow_dispatch:
8+
release:
9+
types:
10+
- created
11+
12+
jobs:
13+
docker:
14+
runs-on: ubuntu-latest
15+
steps:
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)