diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 82af4c6..ae1ba9e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -1,26 +1,25 @@ +# slack actions 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' + - uses: act10ns/slack@v2 with: - context: . - file: ./Dockerfile - push: true - tags: ${{ secrets.DOCKERHUB_USERNAME }}/pythonapp:latest + channel: 'devops' + status: ${{ job.status }} + steps: ${{ toJson(steps) }} + if: always()