Skip to content

Commit

Permalink
Create deploy-container.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
VedatAlpGoktepe authored Aug 3, 2023
1 parent 82b3345 commit bef0441
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker Hub Webhook

on:
push:
# Trigger the workflow when a push is made to the default branch
branches:
- main

# Docker Hub webhook event
docker:
types:
- push

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Deploy container
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
CONTAINER_ENGINE: # Fill in the name of your containerized engine
run: |
# Authenticate with the containerized engine if required
# For example, for Docker Engine:
# echo $DOCKER_HUB_TOKEN | docker login -u $DOCKER_HUB_USERNAME --password-stdin
# Pull the latest image from Docker Hub
docker pull your_dockerhub_username/your_image_name:${GITHUB_SHA}
# Run a script or command to deploy the new image to your containerized engine
# For example, for Docker Engine:
# docker stop your_container_name
# docker rm your_container_name
# docker run -d -p 80:80 --name your_container_name your_dockerhub_username/your_image_name:${GITHUB_SHA}

0 comments on commit bef0441

Please sign in to comment.