Skip to content

Commit

Permalink
feat(adding_dhub_automation): Adding dhub automation (#291)
Browse files Browse the repository at this point in the history
Precommit-Verified: ed3c241d3340295da3142380fbaa23def463a6febf0aac99f99a5a3ac2d6ad41
  • Loading branch information
pryorda authored Sep 26, 2021
1 parent 2cf3505 commit ba56f30
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Push Image
on:
release:
types: [released]

jobs:
build:
name: Build and push image
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: vmware_exporter
tags: latest ${{ github.sha }} ${{ github.ref }}
dockerfiles: |
./Dockerfile
# Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in,
# in which case 'username' and 'password' can be omitted.
- name: Push To dhub
id: push-to-dhub
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-dhub.outputs.registry-paths }}"

0 comments on commit ba56f30

Please sign in to comment.