From 509545f185435cd99b820c0fb0ff9d3bba358df6 Mon Sep 17 00:00:00 2001 From: theoleuthardt Date: Fri, 21 Feb 2025 15:48:28 +0100 Subject: [PATCH] feat: deployment workflow for pushing images to my dockerhub atm --- .github/workflows/deploy.yml | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..8b33032 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,49 @@ +name: Build, Push and Deploy + +on: + pull_request: + types: [closed] + branches: [ main ] + + workflow_dispatch: + inputs: + question: + description: 'NextJS on top?' + required: false + default: 'FR' + type: choice + options: + - 'FR' + - 'FR FR' + +jobs: + build-push-deploy: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Frontend + uses: docker/build-push-action@v6 + with: + context: ./frontend + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/werkzeugkiste-frontend:latest + + - name: Build and Push Backend + uses: docker/build-push-action@v6 + with: + context: ./backend + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/werkzeugkiste-backend:latest \ No newline at end of file