Skip to content

Commit

Permalink
Merge pull request #37 from tigerblue77/32-update-repository-actions-…
Browse files Browse the repository at this point in the history
…to-deploy-this-docker-image-on-ghcr-github-containers-registry-in-addition-to-the-docker-hub

Improved docker-image.yml to also deploy Docker image to ghcr.io
  • Loading branch information
tigerblue77 authored Feb 3, 2023
2 parents acd1043 + 4afcd35 commit 42e8431
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Docker Image CI
name: Docker image CI

on:
push:
branches: [ master ]

jobs:
docker:
build:
name: Build and push Docker image to Docker Hub and GitHub Containers Repository
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -15,19 +16,28 @@ jobs:
id: meta
uses: docker/metadata-action@v4
with:
images: tigerblue77/dell_idrac_fan_controller
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: type=raw,value=latest

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

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

- name: Build and push
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
Expand Down

0 comments on commit 42e8431

Please sign in to comment.