Skip to content

Commit

Permalink
fix: github actions deploy docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
nxhawk committed Jun 23, 2024
1 parent ba8c108 commit 5f158e7
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ on:
pull_request:
branches: [ "dev", "main" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: docker.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:

build:
Expand All @@ -35,31 +29,16 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

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

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
dockerfile: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: image digest
run: echo ${{ steps.build-and-push.outputs.digest }}
- name: image digest
run: echo ${{ steps.build-and-push.outputs.digest }}
tags: ${{ secrets.DOCKER_USERNAME }}/quizz:latest

0 comments on commit 5f158e7

Please sign in to comment.