mirror of
https://github.com/tmdinosaurcenter/kiosk-guestbook.git
synced 2025-04-10 14:11:28 -06:00
Create docker-image.yml
This commit is contained in:
parent
834c81289f
commit
babbc43806
36
.github/workflows/docker-image.yml
vendored
Normal file
36
.github/workflows/docker-image.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
name: Docker Image CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Log in to DockerHub
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build the Docker image
|
||||||
|
id: build-image
|
||||||
|
run: |
|
||||||
|
IMAGE_TAG=my-image-name:${{ github.sha }}
|
||||||
|
docker build . --file Dockerfile --tag $IMAGE_TAG
|
||||||
|
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Uncomment below to push the image to Docker Hub (or another registry)
|
||||||
|
#- name: Push the Docker image
|
||||||
|
# run: docker push ${{ env.IMAGE_TAG }}
|
Loading…
x
Reference in New Issue
Block a user