Skip to content

Commit

Permalink
(#14) - Add a pipeline to build and push the docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
braboj committed Aug 11, 2024
1 parent d7e9a41 commit 677bab3
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Deploy Docker Image

# Controls when the action will run.
on:

# Manual trigger
workflow_dispatch:

# Trigger the deployment on push to the main branch
push:

# Only the main branch
branches: [ "main" ]

# # Only when the Dockerfile changes
# tags:
# - '*'

# The jobs that run in the workflow
jobs:

# Build and push the Docker image
push_to_registry:
name: Build and push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:

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

- name: Build and push Docker image
uses: mr-smithers-excellent/[email protected]
with:
image: braboj/randomgen
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
addLatest: true
pushImage: true

0 comments on commit 677bab3

Please sign in to comment.