From 0f8e1dae3996967d8f237a6fe7389ef126443a3d Mon Sep 17 00:00:00 2001 From: Louis-Antoine Caron Date: Sun, 7 Apr 2024 13:16:36 -0400 Subject: [PATCH] create dev images on dev push --- .github/workflows/dev_backend-deploy.yml | 26 +++++++++++++++++++++++ .github/workflows/dev_deploy.yml | 26 +++++++++++++++++++++++ .github/workflows/dev_frontend-deploy.yml | 26 +++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .github/workflows/dev_backend-deploy.yml create mode 100644 .github/workflows/dev_deploy.yml create mode 100644 .github/workflows/dev_frontend-deploy.yml diff --git a/.github/workflows/dev_backend-deploy.yml b/.github/workflows/dev_backend-deploy.yml new file mode 100644 index 0000000..982d1f4 --- /dev/null +++ b/.github/workflows/dev_backend-deploy.yml @@ -0,0 +1,26 @@ +name: CI/CD Pipeline for Backend + +on: + push: + branches: [ dev ] + +jobs: + build_and_push_backend: + runs-on: ubuntu-latest + steps: + - name: Check Out Repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker image for Backend + uses: docker/build-push-action@v2 + with: + context: ./server + file: ./server/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/dev_${{ secrets.DOCKERHUB_BACKEND_REPO }}:latest diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml new file mode 100644 index 0000000..8a7888d --- /dev/null +++ b/.github/workflows/dev_deploy.yml @@ -0,0 +1,26 @@ +name: CI/CD Pipeline for Nginx Router + +on: + push: + branches: [ dev ] + +jobs: + build_and_push_nginx: + runs-on: ubuntu-latest + steps: + - name: Check Out Repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker image for Router + uses: docker/build-push-action@v2 + with: + context: ./nginx + file: ./nginx/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/dev_${{ secrets.DOCKERHUB_ROUTER_REPO }}:latest diff --git a/.github/workflows/dev_frontend-deploy.yml b/.github/workflows/dev_frontend-deploy.yml new file mode 100644 index 0000000..330dcf1 --- /dev/null +++ b/.github/workflows/dev_frontend-deploy.yml @@ -0,0 +1,26 @@ +name: CI/CD Pipeline for Frontend + +on: + push: + branches: [ dev ] + +jobs: + build_and_push_frontend: + runs-on: ubuntu-latest + steps: + - name: Check Out Repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and Push Docker image for Frontend + uses: docker/build-push-action@v2 + with: + context: ./client + file: ./client/Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/dev_${{ secrets.DOCKERHUB_FRONTEND_REPO }}:latest