From 1a0ab6fb22ba096711ae599b17cace4089154b9a Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Mon, 7 Mar 2022 14:02:40 +0100 Subject: [PATCH] ci(docker): add github action to build docker images automatically --- .github/workflows/docker-build-push.yml | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/docker-build-push.yml diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml new file mode 100644 index 00000000..fe40fa78 --- /dev/null +++ b/.github/workflows/docker-build-push.yml @@ -0,0 +1,35 @@ +name: Build and Push to Docker Hub + +on: + push: + branches: v3 + +jobs: + docker: + runs-on: ubuntu-latest + + steps: + - name: Checkout the repository + uses: actions/checkout@v3.0.0 + + - name: Login to Docker Hub + uses: docker/login-action@v1.14.1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push Server Docker Image + uses: docker/build-push-action@v2.9.0 + with: + context: . + push: true + file: {{context}}/server/Dockerfile + tags: amruthpillai/reactive-resume:server-latest + + - name: Build and Push Client Docker Image + uses: docker/build-push-action@v2.9.0 + with: + context: . + push: true + file: {{context}}/client/Dockerfile + tags: amruthpillai/reactive-resume:client-latest