Skip to content

Commit

Permalink
Updating workflow to run on release publish
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-douglas authored Jul 7, 2022
1 parent 170f2ed commit e81be25
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/main.yml → .github/workflows/publish_image.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Docker Image CI
name: Publish image to Docker Hub

on:
push:
branches: [ "main" ]
release:
types: [published]

jobs:

build:

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

steps:
Expand All @@ -23,9 +23,16 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: mdouglas/tiny-exporter

- name: Build and push Docker images
uses: docker/[email protected]
with:
push: true
tags: mdouglas/tiny-exporter:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.output.labels }}

0 comments on commit e81be25

Please sign in to comment.