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

69 lines
2 KiB
YAML
Raw Normal View History

2024-12-15 01:05:05 +00:00
name: Build and Push Docker Image
on:
push:
paths:
2024-12-15 01:08:53 +00:00
- alaskarfin/version.txt # Trigger workflow only when version.txt changes
2024-12-15 01:05:05 +00:00
jobs:
2024-12-15 01:26:25 +00:00
build-alaskarfin:
2024-12-15 01:05:05 +00:00
runs-on: ubuntu-latest
2024-12-15 01:12:11 +00:00
environment: Dockerhub
2024-12-15 01:05:05 +00:00
steps:
# Step 1: Check out the repository
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Step 3: Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Step 4: Build and push the Docker image
- name: Build and Push Image
uses: docker/build-push-action@v6
with:
2024-12-15 01:08:53 +00:00
context: alaskarfin # Path to the build context
2024-12-15 01:13:21 +00:00
file: alaskarfin/Dockerfile # Path to the Dockerfile
2024-12-15 01:05:05 +00:00
push: true # Push the image to Docker Hub
tags: |
nomadics/alaskarfin:latest
2024-12-15 01:26:25 +00:00
build-alaskarseer:
if: contains(github.event.head_commit.message, 'alaskarseer/version.txt') # Only run if alaskarseer/version.txt changes
runs-on: ubuntu-latest
environment: Dockerhub
steps:
# Step 1: Check out the repository
- name: Checkout code
uses: actions/checkout@v4
# Step 2: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Step 3: Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Step 4: Build and push the alaskarseer image
- name: Build and Push alaskarseer Image
uses: docker/build-push-action@v6
with:
context: alaskarseer # Path to the build context
file: alaskarseer/Dockerfile # Path to the Dockerfile
push: true
tags: |
nomadics/alaskarseer:latest