Skip to content

Commit

Permalink
add CD to dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
arska committed Feb 3, 2023
1 parent 9c81193 commit 7ddb5f7
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CD to Docker Hub

on:
push:
branches: [ master ]
tags: [ '*' ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker labels & tags metadata
id: meta
uses: docker/metadata-action@v4
with:
images: vshn/antora
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push to Docker Hub
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }} # push both tag name and "latest" on new git tag
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 7ddb5f7

Please sign in to comment.