make header required #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
REGISTRY_NAME: hexletbasics | |
CI: true | |
COLOR_MAP: '{ success: "#008000", failure: "#800000" }' | |
IMAGE_NAME: hexletbasics/base-image | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check image building | |
run: docker build . | |
build-push-notify: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
needs: build | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
# NOTE: Using a docker driver reduces build times. | |
driver: docker | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- uses: actions/checkout@v4 | |
- name: Build and push into docker hub | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: ${{ env.IMAGE_NAME }} | |
- name: Send notification into Slack | |
if: ${{ always() }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_COLOR: ${{ fromJson(env.COLOR_MAP)[job.status] }} | |
SLACK_TITLE: ${{ job.status }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |