Skip to content

Instantly share code, notes, and snippets.

@st3fan
Last active January 8, 2025 15:51
Show Gist options
  • Save st3fan/05bbf8272d4d99bc72dcf235ad568184 to your computer and use it in GitHub Desktop.
Save st3fan/05bbf8272d4d99bc72dcf235ad568184 to your computer and use it in GitHub Desktop.
env:
REGISTRY: ghcr.io
IMAGE_NAME: "${{ github.repository }}"
...
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Extract Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Docker Build Push
uses: docker/build-push-action@v6
with:
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment