From 5b1832b84e590af719a76712923674006bb03492 Mon Sep 17 00:00:00 2001 From: samyw10 <97761482+samyw10@users.noreply.github.com> Date: Fri, 5 Apr 2024 15:27:04 -0400 Subject: [PATCH] config ci cd --- .github/workflows/deploy.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 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..c0d259b --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: CI/CD Pipeline for Nginx Router + +on: + push: + branches: [ main ] + paths: + - 'nginx/**' + +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 }}/${{ secrets.DOCKERHUB_ROUTER_REPO }}:latest