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

More reuse and deploy commands

All reuse and deploy commands · GitHub Actions 1 cheatsheet

Was this page helpful?