alaskartv-docker/.github/workflows/docker-build.yml

35 lines
963 B
YAML
Raw Normal View History

2024-12-15 00:11:59 +00:00
name: Build and Push Docker Image
on:
push:
paths:
2024-12-15 00:14:49 +00:00
- alaskarfin/version.txt # Trigger workflow only when version.txt changes
2024-12-15 00:11:59 +00:00
jobs:
build:
runs-on: ubuntu-latest
environment: Dockerhub # Use the Dockerhub environment
steps:
# Step 1: Check out the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Log in to Docker Hub
- name: Log in to Docker Hub
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Step 3: Build the Docker image
- name: Build Docker Image
run: |
2024-12-15 00:32:59 +00:00
docker build -t nomadics/alaskarfin:latest ../../alaskarfin/
2024-12-15 00:11:59 +00:00
# Step 4: Push the Docker image to Docker Hub
2024-12-15 00:30:27 +00:00
# - name: Push Docker Image
# run: |
# docker push nomadics/alaskarfin:latest
2024-12-15 00:11:59 +00:00