From 7d2184186646a6c56749ab3b8f3de523d54617ab Mon Sep 17 00:00:00 2001 From: rituja12 Date: Mon, 23 Dec 2024 12:40:49 +0530 Subject: [PATCH 1/6] run actions for any branch --- .github/workflows/cicd.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 82af4c6..b118db5 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -1,26 +1,26 @@ name: cicd-workflow with slack integration on: push: - branches: [ "master" ] + branches: + - '*' + workflow_dispatch: jobs: - job1: + build: runs-on: ubuntu-latest + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} steps: - uses: actions/checkout@v3 - - name: Build Docker image - run: | - docker build -t my-docker-repo . - - name: Login to Docker Hub - uses: docker/login-action@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v5 + distribution: 'adopt' + java-version: '11' + - name: Build with Maven + run: mvn install -f MyWebApp/pom.xml + - uses: act10ns/slack@v2 with: - context: . - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/pythonapp:latest + channel: '#mar-2024-weekday-batch' + status: ${{ job.status }} + steps: ${{ toJson(steps) }} + if: always() \ No newline at end of file From ef2f92be670a744f83acda0c44f9e0d3366e0313 Mon Sep 17 00:00:00 2001 From: rituja12 <86730020+rituja12@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:47:35 +0530 Subject: [PATCH 2/6] Update cicd.yml --- .github/workflows/cicd.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index b118db5..c91cc9c 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -16,11 +16,9 @@ jobs: with: distribution: 'adopt' java-version: '11' - - name: Build with Maven - run: mvn install -f MyWebApp/pom.xml - uses: act10ns/slack@v2 with: channel: '#mar-2024-weekday-batch' status: ${{ job.status }} steps: ${{ toJson(steps) }} - if: always() \ No newline at end of file + if: always() From d85f2ad16d98637204b82dec8b61a70ef0c0fb81 Mon Sep 17 00:00:00 2001 From: rituja12 Date: Mon, 23 Dec 2024 12:49:35 +0530 Subject: [PATCH 3/6] modifying actions --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index c91cc9c..0f546ef 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -18,7 +18,7 @@ jobs: java-version: '11' - uses: act10ns/slack@v2 with: - channel: '#mar-2024-weekday-batch' + channel: '/#devops' status: ${{ job.status }} steps: ${{ toJson(steps) }} if: always() From c20efc70bc0c73bef5240ec0e3c21092e87e67b9 Mon Sep 17 00:00:00 2001 From: rituja12 <86730020+rituja12@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:51:03 +0530 Subject: [PATCH 4/6] Update cicd.yml --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 0f546ef..061c7e9 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -18,7 +18,7 @@ jobs: java-version: '11' - uses: act10ns/slack@v2 with: - channel: '/#devops' + channel: '#devops' status: ${{ job.status }} steps: ${{ toJson(steps) }} if: always() From 72e84fd8825af18781093a9a51ec8f569e13f229 Mon Sep 17 00:00:00 2001 From: rituja12 <86730020+rituja12@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:53:15 +0530 Subject: [PATCH 5/6] Update cicd.yml --- .github/workflows/cicd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 061c7e9..5a2f029 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -18,7 +18,7 @@ jobs: java-version: '11' - uses: act10ns/slack@v2 with: - channel: '#devops' + channel: 'devops' status: ${{ job.status }} steps: ${{ toJson(steps) }} if: always() From 26d86e7d8b20adae1260edb2d023bd213524bc4c Mon Sep 17 00:00:00 2001 From: rituja12 <86730020+rituja12@users.noreply.github.com> Date: Mon, 23 Dec 2024 12:55:57 +0530 Subject: [PATCH 6/6] Update cicd.yml --- .github/workflows/cicd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 5a2f029..ae1ba9e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -1,3 +1,4 @@ +# slack actions name: cicd-workflow with slack integration on: push: