From e0c2df76b539e0c6d626dc85bc1fc89ec2fe82dd Mon Sep 17 00:00:00 2001 From: Paul Li Date: Sun, 3 Nov 2024 11:44:59 -0700 Subject: [PATCH] add docker publish action --- .github/workflows/docker-publish.yml | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..85747c6 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,31 @@ +name: Build and Push Docker Image + +on: + push: + branches: + - main # Change this to the branch you want to trigger builds on + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: poeli/wastewater_qpcr_app:latest + file: Dockerfile # Update this if your Dockerfile has a different name or location