workflows
This commit is contained in:
parent
211ce4f6a3
commit
1f398c81d6
1 changed files with 34 additions and 0 deletions
34
.github/workflows/docker-build.yml
vendored
Normal file
34
.github/workflows/docker-build.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- version.txt # Trigger workflow only when version.txt changes
|
||||
|
||||
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: |
|
||||
docker build -t nomadics/alaskarfin:latest .
|
||||
|
||||
# Step 4: Push the Docker image to Docker Hub
|
||||
- name: Push Docker Image
|
||||
run: |
|
||||
docker push nomadics/alaskarfin:latest
|
||||
|
Loading…
Reference in a new issue