Publish image to docker hub added
This commit is contained in:
11
.github/workflows/docker-image.yml
vendored
11
.github/workflows/docker-image.yml
vendored
@@ -1,11 +0,0 @@
|
|||||||
name: Docker Image CI
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: Build the Docker image
|
|
||||||
run: docker build . --file Dockerfile --tag hlds:$(date +%s)
|
|
||||||
33
.github/workflows/docker-publish.yml
vendored
Normal file
33
.github/workflows/docker-publish.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Build and Publish Docker Image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main # Trigger on pushes to the 'main' branch
|
||||||
|
workflow_dispatch: # Allow manual triggering of the workflow
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-publish:
|
||||||
|
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
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[](https://github.com/jjsalians/hl-server/actions)
|
[](https://github.com/jjsalinas/hl-server/actions)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user