From d8f61215acd966c0f00a077b63d5a145590b1225 Mon Sep 17 00:00:00 2001 From: Tom <46992402+ttubb@users.noreply.github.com> Date: Wed, 10 Apr 2024 14:23:33 +0200 Subject: [PATCH] new workflow pushes / pulls on main will trigger the built of a docker container, which will be uploaded to ttubb/submg on dockerhub --- .github/workflows/container.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/container.yml diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 0000000..4e86558 --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,28 @@ +name: Build and Push Docker Image + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: ./docker + file: ./docker/Dockerfile + push: true + tags: ttubb/submg:latest # You can also use other tags or versioning schemes