Skip to content

Commit

Permalink
Push container images to GHCR instead of Dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-c committed Oct 18, 2024
1 parent 324a05d commit 0132477
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/docker-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout git commit
uses: actions/checkout@master
uses: actions/checkout@main

- name: Publish to Dockerhub registry
# todo: pin to hash
uses: elgohr/Publish-Docker-Github-Action@3.04
uses: elgohr/Publish-Docker-Github-Action@main
with:
# https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions
name: ${{ github.repository }}
# configured at repo settings/secrets
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
registry: ghcr.io

# GitHub actor
username: ${{ github.actor }}

# GitHub access token
password: ${{ secrets.GITHUB_TOKEN }}

# create docker image tags to match git tags
tag_names: true

0 comments on commit 0132477

Please sign in to comment.