Skip to content

Commit

Permalink
automatically push to dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
meehow committed Dec 30, 2024
1 parent 9661f3e commit eabcdea
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Docker Build & Push (Tags Only)

on:
push:
tags:
- 'v*' # triggers for version tag pushed

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
# Step 1: Check out the repository
- name: Check out code
uses: actions/checkout@v3

# Step 2: Log in to Docker Hub
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u meehow --password-stdin

# Step 3: Build the Docker image
- name: Build Docker image
run: |
docker build -t meehow/privtracker:latest \
-t meehow/privtracker:${{ github.ref_name }} .
# Step 4: Push the Docker image
- name: Push Docker image
run: |
docker push meehow/privtracker:latest
docker push meehow/privtracker:${{ github.ref_name }}

0 comments on commit eabcdea

Please sign in to comment.