From 7ab5a5177348e0ee9f61a72e8a57ad0ce6e17453 Mon Sep 17 00:00:00 2001 From: Rohit T P Date: Sat, 20 Apr 2024 20:54:54 +0000 Subject: [PATCH] feat: automatic build with actions --- .github/workflows/docker-image.yml | 31 ++++++++++++++++++++++++++++++ docker-compose.yml | 4 ---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..8b5bfbf --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,31 @@ +name: Build and Push Docker Images + +on: + push: + branches: + - main + + workflow_dispatch: + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Login to Docker Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile + push: true + tags: | + rohittp0/nginx-secure:${{ github.sha }} + rohittp0/nginx-secure:latest \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4d623b3..4e50427 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,3 @@ services: - ./certs:/etc/letsencrypt/ restart: unless-stopped env_file: docker.env - - web: - image: python:3.11 - command: python -m http.server 8000 \ No newline at end of file