diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..84cd3e0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: Continues Integration Pipeline + +on: + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + dockerimagebuild: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + + - name: FrontEndBuildAndPush + uses: docker/build-push-action@v6 + with: + file: ./Dockerfile.fe + push: true + tags: ozgurozturknet/siemensgitegitim:frontend + + - name: BackendEndBuildAndPush + uses: docker/build-push-action@v6 + with: + file: ./Dockerfile.be + push: true + tags: ozgurozturknet/siemensgitegitim:backend + + - name: DatabaseBuildAndPush + uses: docker/build-push-action@v6 + with: + file: ./Dockerfile.db + push: true + tags: ozgurozturknet/siemensgitegitim:database + \ No newline at end of file diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..d8ebb1c --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,27 @@ +name: ProdDeployment + +on: + push: + branches: [ deploy ] + workflow_dispatch: + +jobs: + deployment: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + + - name: Deploy to Docker swarm + uses: wshihadeh/docker-deployment-action@v1 + with: + remote_docker_host: ubuntu@3.125.43.15 + ssh_private_key: ${{ secrets.DOCKER_SSH_PRIVATE_KEY }} + ssh_public_key: ${{ secrets.DOCKER_SSH_PUBLIC_KEY }} + deployment_mode: docker-compose + stack_file_name: docker-compose.yml + args: "--ansi always" + copy_stack_file: true + deploy_path: /home/ubuntu + keep_files: 5 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f8b4b6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Bu test uygulamasıdır \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 17c8a74..42faf8c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,23 @@ version: '3' services: frontend: - image: ozgurozturknet/fe:proje + image: ozgurozturknet/siemensgitegitim:frontend ports: - "3000:80" # Add any additional configuration for service1 here backend: - image: ozgurozturknet/be:proje + image: ozgurozturknet/siemensgitegitim:backend ports: - "5000:80" + environment: + - DB_HOST=database + - DB_USERNAME=todo_admin + - DB_PASSWORD=password + - DB_NAME=todo_app # Add any additional configuration for service2 here - database: - image: ozgurozturknet/db:proje + image: ozgurozturknet/siemensgitegitim:database ports: - "3306:3306" environment: diff --git a/frontend/index.html b/frontend/index.html index 8ba8a34..30cefed 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,12 +5,12 @@ HTML Web Page -

Merhaba BBDevOpsBootCamp Proje Ekibi

+

Merhaba Siemens R&D Ekibi

::Yapilacaklar Listesi::