GitHub Actions 1 · Reuse and deploy
Build and push a Docker image
Log in to GitHub Container Registry and push an image tagged with the commit SHA.
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
Official GitHub Actions 1 documentation