Skip to content

Commit 74ee61d

Browse files
ci: publish on docker hub
1 parent b3f521c commit 74ee61d

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish on Docker Hub
2+
3+
on:
4+
pull_request:
5+
branches: ["*"]
6+
push:
7+
branches: ["master"]
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Extract metadata (tags, labels) for Docker
20+
id: meta
21+
uses: docker/metadata-action@v4
22+
with:
23+
images: pablocastellano/bee-dashboard
24+
tags: |
25+
type=ref,event=branch
26+
type=ref,event=tag
27+
type=semver,pattern={{version}}
28+
type=raw,value=latest,enable=${{ github.ref_name == 'master' }}
29+
30+
- name: Login to DockerHub
31+
if: github.event_name != 'pull_request'
32+
uses: docker/login-action@v2
33+
with:
34+
username: ${{ secrets.DOCKERHUB_USERNAME }}
35+
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
37+
- name: Build and push
38+
uses: docker/build-push-action@v4
39+
with:
40+
context: .
41+
push: ${{ github.event_name != 'pull_request' }}
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)