Skip to content

Commit

Permalink
ci: publish on docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCastellano committed Jan 19, 2024
1 parent b3f521c commit 3101afc
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish_docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish on Docker Hub

on:
pull_request:
branches: ["*"]
push:
branches: ["master"]
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: pablocastellano/bee-dashboard
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=raw,value=latest,enable=${{ github.ref_name == 'master' }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 3101afc

Please sign in to comment.