Skip to content

Commit

Permalink
Unhardcoding cd-docker-hub.yml (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
UnAfraid authored Jan 11, 2023
1 parent 498e0cf commit 81059d5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/cd-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ on:
types: [ published ]

env:
REGISTRY: ajustesen
IMAGE_NAME: ${{ github.repository }}
PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7

jobs:
Expand All @@ -40,17 +38,21 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- id: docker-image-to-lowercase
name: Convert Docker image to lower case
run: echo "DOCKER_IMAGE=$(echo ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.DOCKER_IMAGE }}

- name: Build and push image to Docker Hub
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: ${{ env.PLATFORMS }}
tags: ajustesen/speedtest-tracker:latest
tags: ${{ env.DOCKER_IMAGE }}:latest
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 81059d5

Please sign in to comment.