Skip to content

Commit

Permalink
ghactions: publish docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlemetayer committed Sep 13, 2021
1 parent 142c30d commit afc9ac2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Publish Docker image"

on: push

jobs:
push_to_registry:
name: "Push Docker image to Docker Hub"
runs-on: ubuntu-latest
steps:
- name: "Check out the repo"
uses: actions/checkout@v2

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

- name: "Extract metadata (tags, labels) for Docker"
id: meta
uses: docker/metadata-action@v3
with:
images: jmlemetayer/abba
flavor: |
latest=true
- name: "Build and push Docker image"
uses: docker/build-push-action@v2
with:
context: docker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit afc9ac2

Please sign in to comment.