From 75660a56d7f6cb613a0ad2bb4bf60253d7cbf13d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ron=20Nosz=C3=A1ly?= Date: Mon, 26 Aug 2024 18:35:23 +0200 Subject: [PATCH] Add docker workflow --- .github/workflows/docker.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..74a8f323 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,35 @@ +name: Build and Push Docker Images + +on: + push: + branches: + - docker + workflow_dispatch: + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Build and push frontend Docker image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/njudge:latest + + - name: Logout from Docker Hub + run: docker logout