From 24c331f3fef251f3ce9fa412edbe06ccc8f6c6f4 Mon Sep 17 00:00:00 2001 From: Sojabio Date: Thu, 22 Aug 2024 15:20:41 +0200 Subject: [PATCH] dockerhub ci --- .github/workflows/docker.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 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 0000000..5d60f78 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,34 @@ +name: docker-ci + +on: push + +jobs: + docker-front: + needs: frontend-tests-workflow + if: github.ref == 'refs/heads/dev' + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push frontend + uses: docker/build-push-action@v4 + with: + push: true + context: "{{defaultContext}}:frontend" + file: Dockerfile.prod + tags: ${{ secrets.DOCKERHUB_USERNAME }}/wildrent-frontend:latest + - name: Build and push backend + uses: docker/build-push-action@v4 + with: + push: true + context: "{{defaultContext}}:backend" + file: Dockerfile.prod + tags: ${{ secrets.DOCKERHUB_USERNAME }}/wildrent-backend:latest + \ No newline at end of file