hellodocker/.gitea/workflows/docker-build-slack.yaml
Tom Carron 43e783f130
Some checks failed
Build and Push Docker Image then Slack webhook / build-and-push (push) Failing after 23s
Build and Push Docker Image then Slack webhook / slack-notification (push) Has been skipped
first commit
2025-05-22 15:57:46 +01:00

31 lines
1.0 KiB
YAML

name: Build and Push Docker Image then Slack webhook
on:
push:
branches:
- main # Change this if needed
pull_request:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
run: echo "${{ secrets.REGISTRY_TOKEN_GITEA }}" | docker login git.adaptcentre.ie -u "${{ secrets.USERNAME_GITEA }}" --password-stdin
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_IMAGE_NAME }} .
- name: Push Docker image to Gitea Registry
run: docker push ${{ secrets.DOCKER_IMAGE_NAME }}
slack-notification:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text": "Image build for ${{ gitea.repository }} on branch ${{ gitea.ref }} completed with status: ${{ needs.build-and-push.result }}."}' "${{ secrets.SLACK_WEBHOOK_URL }}"