Skip to content

Commit

Permalink
feat: auto build and push docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
vvanglro committed Dec 9, 2022
1 parent 2d6053d commit 6b3f9fd
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Docker image

on:
push:
tags:
- '*'

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-20.04

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: vvanglro/cf-clearance

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 6b3f9fd

Please sign in to comment.