Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fey committed Jun 7, 2024
1 parent eccea3c commit 9d92086
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/Docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ env:
REGISTRY_NAME: hexletbasics
CI: true
COLOR_MAP: '{ success: "#008000", failure: "#800000" }'
IMAGE_NAME: hexletbasics/base-image

jobs:
build:
Expand All @@ -24,17 +25,25 @@ jobs:
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: Set repository name
run: |
echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')" >> $GITHUB_ENV

- name: Build and push into docker hub
uses: docker/build-push-action@v5
with:
repository: ${{ env.REGISTRY_NAME }}/${{ env.REPOSITORY_NAME }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: latest
push: true
tags: ${{ env.APP_IMAGE_NAME }}

- name: Send notification into Slack
if: ${{ always() }}
Expand Down

0 comments on commit 9d92086

Please sign in to comment.