From db2acddbc68920d3b630dc1189988ad4014bda76 Mon Sep 17 00:00:00 2001 From: Steve Dogiakos Date: Wed, 2 Apr 2025 18:16:53 -0600 Subject: [PATCH] trying a docker action workflow Added Docker secrets so hopefully it will run now. --- .github/workflows/docker-image.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..5e5565e --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,28 @@ +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