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