Update docker-publish.yml

This commit is contained in:
Jose Jimenez
2025-06-01 21:51:17 +02:00
committed by GitHub
parent d1ba8e06d8
commit 3afac4db07

View File

@@ -3,7 +3,7 @@ name: Build and Publish Docker Image
on: on:
push: push:
branches: branches:
- main # Trigger on pushes to the 'main' branch - main
workflow_dispatch: # Allow manual triggering of the workflow workflow_dispatch: # Allow manual triggering of the workflow
jobs: jobs:
@@ -11,23 +11,19 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Checkout the code
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
# Log in to Docker Hub using GitHub credentials
- name: Log in to Docker Hub - name: Log in to Docker Hub
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
# Build the Docker image
- name: Build Docker Image - name: Build Docker Image
run: | run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/hl-server:latest . docker build -t ${{ secrets.DOCKER_USERNAME }}/hl-server:latest .
# Push the Docker image to Docker Hub
- name: Push Docker Image - name: Push Docker Image
run: | run: |
docker push ${{ secrets.DOCKER_USERNAME }}/hl-server:latest docker push ${{ secrets.DOCKER_USERNAME }}/hl-server:latest